Skip to content

Commit

Permalink
Fix issue #2 -- "Close" button element wasn't being removed when moda…
Browse files Browse the repository at this point in the history
…l was closed.
  • Loading branch information
kylefox committed Apr 9, 2011
1 parent 3da2f27 commit 8998d63
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions jquery.modal.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
A simple jQuery modal (http:https://github.com/kylefox/jquery-modal)
Version 0.2.1
Version 0.2.2
*/
(function() {

Expand Down Expand Up @@ -42,7 +42,8 @@
function show() {
center_modal(current_modal);
if(options.showClose) {
current_modal.elm.append('<a href="#close-modal" rel="modal:close" class="close-modal">Close</a>');
current_modal.closeButton = $('<a href="#close-modal" rel="modal:close" class="close-modal">Close</a>');
current_modal.elm.append(current_modal.closeButton);
}
$elm.addClass(options.modalClass).addClass('current').show();
$elm.trigger($.fn.modal.OPEN, [current_modal]);
Expand Down Expand Up @@ -82,6 +83,9 @@
}

current_modal.elm.trigger($.fn.modal.BEFORE_CLOSE, [current_modal]);
if(current_modal.closeButton) {
current_modal.closeButton.remove();
}
current_modal.blocker.remove();
current_modal.elm.hide();
current_modal.elm.trigger($.fn.modal.CLOSE, [current_modal]);
Expand Down
7 changes: 4 additions & 3 deletions jquery.modal.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions jquery.modal.pack.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8998d63

Please sign in to comment.