From 48aa209348c47df65f4edb0d8a36ccaac357eb0a Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 10 Sep 2011 12:49:21 -0700 Subject: more tests, more js goodness --- js/bootstrap-modal.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'js/bootstrap-modal.js') diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js index 4b4f05ae36..54cbad4b11 100644 --- a/js/bootstrap-modal.js +++ b/js/bootstrap-modal.js @@ -40,10 +40,10 @@ } this.$element = $(content) - .bind('modal:open', $.proxy(this.open, this)) - .bind('modal:close', $.proxy(this.close, this)) + .bind('modal:show', $.proxy(this.show, this)) + .bind('modal:hide', $.proxy(this.hide, this)) .bind('modal:toggle', $.proxy(this.toggle, this)) - .delegate('.close', 'click', $.proxy(this.close, this)) + .delegate('.close', 'click', $.proxy(this.hide, this)) return this } @@ -51,12 +51,12 @@ Modal.prototype = { toggle: function () { - return this[!this.isOpen ? 'open' : 'close']() + return this[!this.isShown ? 'show' : 'hide']() } - , open: function () { + , show: function () { var that = this - this.isOpen = true + this.isShown = true _.escape.call(this) _.backdrop.call(this) @@ -73,12 +73,12 @@ return this } - , close: function (e) { + , hide: function (e) { e && e.preventDefault() var that = this - this.isOpen = false + this.isShown = false _.escape.call(this) _.backdrop.call(this) @@ -108,11 +108,11 @@ backdrop: function () { var that = this , animate = this.$element.hasClass('fade') ? 'fade' : '' - if ( this.isOpen && this.settings.backdrop ) { + if ( this.isShown && this.settings.backdrop ) { this.$backdrop = $('