From 2865c27389efc735164323371b5aac6a06ec05ba Mon Sep 17 00:00:00 2001 From: Adrian Olaru Date: Sat, 18 Feb 2012 12:35:14 +0200 Subject: [PATCH] Minor bug fixing 'this' is the jQuery object inside fn, no need to wrap it another $ object use the constant for close event name --- jquery.modal.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.modal.js b/jquery.modal.js index 7afe27d..5381a7b 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -8,7 +8,7 @@ $.fn.modal = function(options) { - var $elm = $(this); + var $elm = this; // If this is a link, bind to its click event. if($elm.attr('href')) { @@ -109,7 +109,7 @@ $('
') .html(html) .appendTo('body') - .on('modal:close', function(event, modal) { modal.elm.remove(); }) + .on($.fn.modal.CLOSE, function(event, modal) { modal.elm.remove(); }) .modal(); }); }