|
@ -236,7 +236,7 @@ $.fn.popup = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
show: function(callback) { |
|
|
show: function(callback) { |
|
|
callback = callback || function(){}; |
|
|
|
|
|
|
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
|
module.debug('Showing pop-up', settings.transition); |
|
|
module.debug('Showing pop-up', settings.transition); |
|
|
if(!settings.preserve && !settings.popup) { |
|
|
if(!settings.preserve && !settings.popup) { |
|
|
module.refresh(); |
|
|
module.refresh(); |
|
@ -252,7 +252,7 @@ $.fn.popup = function(parameters) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hide: function(callback) { |
|
|
hide: function(callback) { |
|
|
callback = callback || function(){}; |
|
|
|
|
|
|
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
|
$module |
|
|
$module |
|
|
.removeClass(className.visible) |
|
|
.removeClass(className.visible) |
|
|
; |
|
|
; |
|
@ -313,6 +313,7 @@ $.fn.popup = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
restore: { |
|
|
restore: { |
|
|
conditions: function() { |
|
|
conditions: function() { |
|
|
|
|
|
element.blur(); |
|
|
if(module.cache && module.cache.title) { |
|
|
if(module.cache && module.cache.title) { |
|
|
$module.attr('title', module.cache.title); |
|
|
$module.attr('title', module.cache.title); |
|
|
module.verbose('Restoring original attributes', module.cache.title); |
|
|
module.verbose('Restoring original attributes', module.cache.title); |
|
@ -322,7 +323,7 @@ $.fn.popup = function(parameters) { |
|
|
}, |
|
|
}, |
|
|
animate: { |
|
|
animate: { |
|
|
show: function(callback) { |
|
|
show: function(callback) { |
|
|
callback = callback || function(){}; |
|
|
|
|
|
|
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
$popup |
|
|
$popup |
|
|
.transition({ |
|
|
.transition({ |
|
@ -356,7 +357,7 @@ $.fn.popup = function(parameters) { |
|
|
$.proxy(settings.onShow, element)(); |
|
|
$.proxy(settings.onShow, element)(); |
|
|
}, |
|
|
}, |
|
|
hide: function(callback) { |
|
|
hide: function(callback) { |
|
|
callback = callback || function(){}; |
|
|
|
|
|
|
|
|
callback = $.isFunction(callback) ? callback : function(){}; |
|
|
module.debug('Hiding pop-up'); |
|
|
module.debug('Hiding pop-up'); |
|
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) { |
|
|
$popup |
|
|
$popup |
|
@ -366,6 +367,7 @@ $.fn.popup = function(parameters) { |
|
|
duration : settings.duration, |
|
|
duration : settings.duration, |
|
|
onComplete : function() { |
|
|
onComplete : function() { |
|
|
module.reset(); |
|
|
module.reset(); |
|
|
|
|
|
console.log(callback, $.isFunction(callback), typeof callback); |
|
|
callback(); |
|
|
callback(); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -634,11 +636,21 @@ $.fn.popup = function(parameters) { |
|
|
popup: function() { |
|
|
popup: function() { |
|
|
module.verbose('Allowing hover events on popup to prevent closing'); |
|
|
module.verbose('Allowing hover events on popup to prevent closing'); |
|
|
$popup |
|
|
$popup |
|
|
.on('mouseenter', module.event.start) |
|
|
|
|
|
.on('mouseleave', module.event.end) |
|
|
|
|
|
|
|
|
.on('mouseenter' + eventNamespace, module.event.start) |
|
|
|
|
|
.on('mouseleave' + eventNamespace, module.event.end) |
|
|
; |
|
|
; |
|
|
}, |
|
|
}, |
|
|
close:function() { |
|
|
close:function() { |
|
|
|
|
|
if(settings.hideOnScroll) { |
|
|
|
|
|
$document |
|
|
|
|
|
.on('touchmove' + eventNamespace, module.hideGracefully) |
|
|
|
|
|
.on('scroll' + eventNamespace, module.hideGracefully) |
|
|
|
|
|
; |
|
|
|
|
|
$context |
|
|
|
|
|
.on('touchmove' + eventNamespace, module.hideGracefully) |
|
|
|
|
|
.on('scroll' + eventNamespace, module.hideGracefully) |
|
|
|
|
|
; |
|
|
|
|
|
} |
|
|
if(settings.on == 'click' && settings.closable) { |
|
|
if(settings.on == 'click' && settings.closable) { |
|
|
module.verbose('Binding popup close event to document'); |
|
|
module.verbose('Binding popup close event to document'); |
|
|
$document |
|
|
$document |
|
@ -653,6 +665,14 @@ $.fn.popup = function(parameters) { |
|
|
|
|
|
|
|
|
unbind: { |
|
|
unbind: { |
|
|
close: function() { |
|
|
close: function() { |
|
|
|
|
|
if(settings.hideOnScroll) { |
|
|
|
|
|
$document |
|
|
|
|
|
.off('scroll' + eventNamespace, module.hide) |
|
|
|
|
|
; |
|
|
|
|
|
$context |
|
|
|
|
|
.off('scroll' + eventNamespace, module.hide) |
|
|
|
|
|
; |
|
|
|
|
|
} |
|
|
if(settings.on == 'click' && settings.closable) { |
|
|
if(settings.on == 'click' && settings.closable) { |
|
|
module.verbose('Removing close event from document'); |
|
|
module.verbose('Removing close event from document'); |
|
|
$document |
|
|
$document |
|
@ -892,6 +912,7 @@ $.fn.popup.settings = { |
|
|
|
|
|
|
|
|
on : 'hover', |
|
|
on : 'hover', |
|
|
closable : true, |
|
|
closable : true, |
|
|
|
|
|
hideOnScroll : true, |
|
|
|
|
|
|
|
|
context : 'body', |
|
|
context : 'body', |
|
|
position : 'top left', |
|
|
position : 'top left', |
|
|