]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: prevent error when the value of $anchorDims is null 11832/head
authorDaniel Ruf <mac1@daniel-ruf.de>
Sat, 5 Oct 2019 15:52:10 +0000 (17:52 +0200)
committerDaniel Ruf <mac1@daniel-ruf.de>
Sat, 5 Oct 2019 15:52:10 +0000 (17:52 +0200)
js/foundation.util.box.js

index 11688c35861b4c22203a1c7d7c6ae419e7b30dc0..360c044a65896aeba5858548d7110eb8fa861760 100644 (file)
@@ -124,8 +124,8 @@ function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffs
 
       var topVal, leftVal;
 
+  if ($anchorDims !== null) {
   // set position related attribute
-
   switch (position) {
     case 'top':
       topVal = $anchorDims.offset.top - ($eleDims.height + vOffset);
@@ -141,7 +141,6 @@ function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffs
       break;
   }
 
-
   // set alignment related attribute
   switch (position) {
     case 'top':
@@ -173,6 +172,8 @@ function GetExplicitOffsets(element, anchor, position, alignment, vOffset, hOffs
       }
       break;
   }
+  }
+
   return {top: topVal, left: leftVal};
 }