diff --git a/docs/index.html b/docs/index.html index ab66d968ce..d8febe0a4b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -21,7 +21,7 @@ - + diff --git a/docs/javascript.html b/docs/javascript.html index 7d1c6d6ca4..8a4636bb3d 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -89,12 +89,12 @@ $('#modal-content').modal({

modal:toggle

Toggle the modal open state.

$('#modal-content').trigger('modal:toggle')
-

modal:open

+

modal:show

Opens the modal.

-
$('#modal-content').trigger('modal:open')
-

modal:close

+
$('#modal-content').trigger('modal:show')
+

modal:hide

Closes the modal.

-
$('#modal-content').trigger('modal:close')
+
$('#modal-content').trigger('modal:hide')

Demo

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 = $('