1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-06 13:46:42 +02:00

add some more events to alerts and modal and update docs

This commit is contained in:
Jacob Thornton
2011-09-10 14:04:22 -07:00
parent 5bc455d370
commit 5f65df9e2d
3 changed files with 50 additions and 11 deletions

View File

@@ -34,10 +34,11 @@
var Alert = function ( content ) {
var that = this
this.$element = $(content)
this.$element.delegate('.close', 'click', function (e) {
e.preventDefault()
that.close()
})
.bind('alert:hide', $.proxy(this.close, this))
.delegate('.close', 'click', function (e) {
e.preventDefault()
that.close()
})
}
Alert.prototype = {

View File

@@ -66,7 +66,7 @@
.show()
setTimeout(function () {
that.$element.addClass('in')
that.$element.addClass('in').trigger('modal:shown')
that.$backdrop && that.$backdrop.addClass('in')
}, 1)
@@ -86,8 +86,10 @@
this.$element.removeClass('in')
function removeElement () {
that.$element.unbind(transitionEnd)
that.$element.detach()
that.$element
.unbind(transitionEnd)
.detach()
.trigger('modal:hidden')
}
$.support.transition && this.$element.hasClass('fade') ?