Browse Source

Remove $.proxy calls from popup

pull/1615/head
jlukic 10 years ago
parent
commit
122a0e7684
1 changed files with 13 additions and 11 deletions
  1. 24
      src/definitions/modules/popup.js

24
src/definitions/modules/popup.js

@ -231,7 +231,7 @@ $.fn.popup = function(parameters) {
if(settings.hoverable) { if(settings.hoverable) {
module.bind.popup(); module.bind.popup();
} }
$.proxy(settings.onCreate, $popup)(element);
settings.onCreate.call($popup, element);
} }
else if($target.next(settings.selector.popup).length !== 0) { else if($target.next(settings.selector.popup).length !== 0) {
module.verbose('Pre-existing popup found, reverting to inline'); module.verbose('Pre-existing popup found, reverting to inline');
@ -325,7 +325,7 @@ $.fn.popup = function(parameters) {
if( module.has.popup() ) { if( module.has.popup() ) {
$popup.remove(); $popup.remove();
} }
$.proxy(settings.onRemove, $popup)(element);
settings.onRemove.call($popup, element);
}, },
save: { save: {
@ -362,8 +362,8 @@ $.fn.popup = function(parameters) {
duration : settings.duration, duration : settings.duration,
onComplete : function() { onComplete : function() {
module.bind.close(); module.bind.close();
$.proxy(callback, $popup)(element);
$.proxy(settings.onVisible, $popup)(element);
callback.call($popup, element);
settings.onVisible.call($popup, element);
} }
}) })
; ;
@ -374,11 +374,12 @@ $.fn.popup = function(parameters) {
.stop() .stop()
.fadeIn(settings.duration, settings.easing, function() { .fadeIn(settings.duration, settings.easing, function() {
module.bind.close(); module.bind.close();
$.proxy(callback, element)();
callback.call($popup, element);
settings.onVisible.call($popup, element);
}) })
; ;
} }
$.proxy(settings.onShow, $popup)(element);
settings.onShow.call($popup, element);
}, },
hide: function(callback) { hide: function(callback) {
callback = $.isFunction(callback) ? callback : function(){}; callback = $.isFunction(callback) ? callback : function(){};
@ -393,8 +394,8 @@ $.fn.popup = function(parameters) {
verbose : settings.verbose, verbose : settings.verbose,
onComplete : function() { onComplete : function() {
module.reset(); module.reset();
$.proxy(callback, $popup)(element);
$.proxy(settings.onHidden, $popup)(element);
callback.call($popup, element);
settings.onHidden.call($popup, element);
} }
}) })
; ;
@ -404,11 +405,12 @@ $.fn.popup = function(parameters) {
.stop() .stop()
.fadeOut(settings.duration, settings.easing, function() { .fadeOut(settings.duration, settings.easing, function() {
module.reset(); module.reset();
callback();
callback.call($popup, element);
settings.onHidden.call($popup, element);
}) })
; ;
} }
$.proxy(settings.onHide, $popup)(element);
settings.onHide.call($popup, element);
} }
}, },
@ -771,7 +773,7 @@ $.fn.popup = function(parameters) {
$document $document
.on('click' + eventNamespace, function(event) { .on('click' + eventNamespace, function(event) {
module.verbose('Pop-up clickaway intent detected'); module.verbose('Pop-up clickaway intent detected');
$.proxy(module.hideGracefully, element)(event);
module.hideGracefully.call(element, event);
}) })
; ;
} }

Loading…
Cancel
Save