From 6f89147aa0851420150984a6fd65dec7cfe281f9 Mon Sep 17 00:00:00 2001 From: Daniel Ruf Date: Sat, 5 Oct 2019 17:52:10 +0200 Subject: [PATCH] fix: prevent error when the value of $anchorDims is null --- js/foundation.util.box.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/foundation.util.box.js b/js/foundation.util.box.js index 11688c358..360c044a6 100644 --- a/js/foundation.util.box.js +++ b/js/foundation.util.box.js @@ -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}; } -- 2.47.2