Skip to content

Commit

Permalink
opt out the spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
adiospace committed Apr 19, 2012
1 parent 2fc94c7 commit 449671d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions jquery.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
remove = function(event, modal) { modal.elm.remove(); };
this.showSpinner();
$.get(target).done(function(html) {
if (!current) return;
current.$elm.empty().append(html).appendTo('body').on($.modal.CLOSE, remove);
current.hideSpinner();
current.open();
}).fail(function(error) {
current.hideSpinner();
});
if (!current) return;
current.$elm.empty().append(html).appendTo('body').on($.modal.CLOSE, remove);
current.hideSpinner();
current.open();
}).fail(function(error) {
current.hideSpinner();
});
}
} else {
this.$elm = el;
Expand Down Expand Up @@ -93,14 +93,15 @@
},

showSpinner: function() {
if (!this.options.showSpinner) return;
this.spinner = $('<div class="' + this.options.modalClass + '-spinner"></div>')
.append(this.options.spinnerHtml);
$('body').append(this.spinner);
this.spinner.show();
},

hideSpinner: function() {
this.spinner.fadeOut();
if (this.spinner) this.spinner.fadeOut();
},

center: function() {
Expand Down Expand Up @@ -144,6 +145,7 @@
closeText: 'Close',
modalClass: "modal",
spinnerHtml: null,
showSpinner: true,
showClose: true
};

Expand Down

0 comments on commit 449671d

Please sign in to comment.