Browse Source

Finish rewrite of popup positioning #1605

pull/1627/head
jlukic 9 years ago
parent
commit
81ab3b98a6
1 changed files with 11 additions and 7 deletions
  1. 18
      src/definitions/modules/popup.js

18
src/definitions/modules/popup.js

@ -90,9 +90,6 @@ $.fn.popup = function(parameters) {
if( !module.exists() && settings.preserve) {
module.create();
}
else if(settings.hoverable) {
module.bind.popup();
}
module.instantiate();
},
@ -229,20 +226,27 @@ $.fn.popup = function(parameters) {
.appendTo( $context )
;
}
module.refresh();
if(settings.hoverable) {
module.bind.popup();
}
settings.onCreate.call($popup, element);
module.refresh();
}
else if($target.next(selector.popup).length !== 0) {
module.verbose('Pre-existing popup found, reverting to inline');
module.verbose('Pre-existing popup found');
settings.inline = true;
settings.popup = $target.next(selector.popup);
settings.popup = $target.next(selector.popup);
module.refresh();
if(settings.hoverable) {
module.bind.popup();
}
}
else if(settings.popup) {
module.verbose('Used popup specified in settings');
module.refresh();
if(settings.hoverable) {
module.bind.popup();
}
}
else {
module.debug('No content specified skipping display', element);
@ -466,7 +470,6 @@ $.fn.popup = function(parameters) {
},
offstagePosition: function(position) {
var
position = position || false,
boundary = {
top : $(window).scrollTop(),
bottom : $(window).scrollTop() + $(window).height(),
@ -481,6 +484,7 @@ $.fn.popup = function(parameters) {
offstage = {},
offstagePositions = []
;
position = position || false;
if(popup.offset && position) {
module.verbose('Checking if outside viewable area', popup.offset);
offstage = {

Loading…
Cancel
Save