Skip to content

Commit

Permalink
Minor bug fixing
Browse files Browse the repository at this point in the history
'this' is the jQuery object inside fn, no need to wrap it another $ object
use the constant for close event name
  • Loading branch information
adiospace committed Feb 18, 2012
1 parent 148d228 commit 2865c27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -109,7 +109,7 @@
$('<div/>')
.html(html)
.appendTo('body')
.on('modal:close', function(event, modal) { modal.elm.remove(); })
.on($.fn.modal.CLOSE, function(event, modal) { modal.elm.remove(); })
.modal();
});
}
Expand Down

0 comments on commit 2865c27

Please sign in to comment.