Skip to content

Commit

Permalink
Only create spinner where necessary, remove from DOM when "hidden"
Browse files Browse the repository at this point in the history
  • Loading branch information
kylefox committed Apr 20, 2012
1 parent 5005ae8 commit 40bae80
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 @@ -96,14 +96,14 @@

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

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

center: function() {
Expand Down

0 comments on commit 40bae80

Please sign in to comment.