|
|
@ -111,12 +111,21 @@ $.fn.popup = function(parameters) { |
|
|
|
? $target.next(settings.selector.popup) |
|
|
|
: false |
|
|
|
; |
|
|
|
$offsetParent = (settings.popup) |
|
|
|
? $popup.offsetParent() |
|
|
|
: (settings.inline) |
|
|
|
? $target.offsetParent() |
|
|
|
: $body |
|
|
|
; |
|
|
|
if(settings.popup) { |
|
|
|
$popup.addClass(className.loading); |
|
|
|
$offsetParent = $popup.offsetParent(); |
|
|
|
$popup.removeClass(className.loading); |
|
|
|
} |
|
|
|
else { |
|
|
|
$offsetParent = (settings.inline) |
|
|
|
? $target.offsetParent() |
|
|
|
: $body |
|
|
|
; |
|
|
|
} |
|
|
|
if( $offsetParent.is('html') ) { |
|
|
|
module.debug('Page is popups offset parent'); |
|
|
|
$offsetParent = $body; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
reposition: function() { |
|
|
@ -431,7 +440,7 @@ $.fn.popup = function(parameters) { |
|
|
|
top : (popup.offset.top < boundary.top), |
|
|
|
bottom : (popup.offset.top + popup.height > boundary.bottom), |
|
|
|
right : (popup.offset.left + popup.width > boundary.right), |
|
|
|
left : (popup.offset.left < boundary.left) |
|
|
|
left : false |
|
|
|
}; |
|
|
|
} |
|
|
|
// return only boundaries that have been surpassed
|
|
|
@ -488,13 +497,8 @@ $.fn.popup = function(parameters) { |
|
|
|
popupWidth = $popup.outerWidth(), |
|
|
|
popupHeight = $popup.outerHeight(), |
|
|
|
|
|
|
|
parentWidth = ( $offsetParent.is('html') ) |
|
|
|
? $offsetParent.find('body').width() |
|
|
|
: $offsetParent.outerWidth(), |
|
|
|
|
|
|
|
parentHeight = ( $offsetParent.is('html') ) |
|
|
|
? $offsetParent.find('body').height() |
|
|
|
: $offsetParent.outerHeight(), |
|
|
|
parentWidth = $offsetParent.outerWidth(), |
|
|
|
parentHeight = $offsetParent.outerHeight(), |
|
|
|
|
|
|
|
distanceAway = settings.distanceAway, |
|
|
|
|
|
|
@ -608,8 +612,10 @@ $.fn.popup = function(parameters) { |
|
|
|
.addClass(position) |
|
|
|
.addClass(className.loading) |
|
|
|
; |
|
|
|
console.log('here1'); |
|
|
|
// check if is offstage
|
|
|
|
offstagePosition = module.get.offstagePosition(position); |
|
|
|
|
|
|
|
// recursively find new positioning
|
|
|
|
if(offstagePosition) { |
|
|
|
module.debug('Element is outside boundaries', offstagePosition); |
|
|
@ -633,6 +639,9 @@ $.fn.popup = function(parameters) { |
|
|
|
else { |
|
|
|
module.debug('Position is on stage', position); |
|
|
|
searchDepth = 0; |
|
|
|
if( settings.setFluidWidth && $popup.hasClass(className.fluid) ) { |
|
|
|
$popup.css('width', $offsetParent.width()); |
|
|
|
} |
|
|
|
$popup.removeClass(className.loading); |
|
|
|
return true; |
|
|
|
} |
|
|
@ -939,6 +948,8 @@ $.fn.popup.settings = { |
|
|
|
hide : 0 |
|
|
|
}, |
|
|
|
|
|
|
|
setFluidWidth : true, |
|
|
|
|
|
|
|
target : false, |
|
|
|
popup : false, |
|
|
|
inline : false, |
|
|
@ -972,6 +983,7 @@ $.fn.popup.settings = { |
|
|
|
active : 'active', |
|
|
|
animating : 'animating', |
|
|
|
dropdown : 'dropdown', |
|
|
|
fluid : 'fluid', |
|
|
|
loading : 'loading', |
|
|
|
popup : 'ui popup', |
|
|
|
position : 'top left center bottom right', |
|
|
|