From 5b2b1981018722cdb3aab047011f1be94f97c178 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 13 Jul 2015 15:20:32 -0400 Subject: [PATCH] #2526 Add jitter to deal with rounding issues when popup is adjacent to edge --- src/definitions/modules/popup.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index a5eaecaef..3419fef7b 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -495,10 +495,10 @@ $.fn.popup = function(parameters) { // calculate screen boundaries screen = calculations.screen; calculations.boundary = { - top : screen.scroll.top, - bottom : screen.scroll.top + screen.height, - left : screen.scroll.left, - right : screen.scroll.left + screen.width + top : screen.scroll.top - settings.jitter, + bottom : screen.scroll.top + screen.height + settings.jitter, + left : screen.scroll.left - settings.jitter, + right : screen.scroll.left + screen.width + settings.jitter }; return calculations; }, @@ -1171,7 +1171,7 @@ $.fn.popup.settings = { name : 'Popup', // module settings - debug : false, + debug : true, verbose : false, performance : true, namespace : 'popup', @@ -1267,6 +1267,9 @@ $.fn.popup.settings = { // distance away from activating element in px distanceAway : 0, + // number of pixels an element is allowed to be "offstage" (allows for rounding errors) + jitter : 2, + // offset on aligning axis from calculated position offset : 0,