Browse Source

#2526 Add jitter to deal with rounding issues when popup is adjacent to edge

pull/2616/merge
jlukic 9 years ago
parent
commit
5b2b198101
1 changed files with 8 additions and 5 deletions
  1. 13
      src/definitions/modules/popup.js

13
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,

Loading…
Cancel
Save