From 18ac909518276804e998cf7d92be79f3e66c6647 Mon Sep 17 00:00:00 2001 From: Jack Date: Sun, 28 Jan 2018 18:37:20 -0800 Subject: [PATCH] #5366, #5975 - Fixes issue with offset not available on window --- src/definitions/modules/dropdown.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index a37438001c..efecda13ad 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -3216,7 +3216,9 @@ $.fn.dropdown = function(parameters) { ; calculations = { context: { - offset : $context.offset(), + offset : ($context.get(0) === window) + ? { top: 0, left: 0} + : $context.offset(), scrollTop : $context.scrollTop(), height : $context.outerHeight() }, @@ -3259,7 +3261,9 @@ $.fn.dropdown = function(parameters) { ; calculations = { context: { - offset : $context.offset(), + offset : ($context.get(0) === window) + ? { top: 0, left: 0} + : $context.offset(), scrollLeft : $context.scrollLeft(), width : $context.outerWidth() },