Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2011-09-11 01:04:22 +0400
committerJacob Thornton <jacobthornton@gmail.com>2011-09-11 01:04:22 +0400
commit5f65df9e2db7c16c3c64930331a467e18501e20c (patch)
tree317a508fe3b3a79f7b06e273e4d57a5199dd7e0c /js
parent5bc455d3707b87960d32c0672f5afb3b31173ec8 (diff)
add some more events to alerts and modal and update docs
Diffstat (limited to 'js')
-rw-r--r--js/bootstrap-alerts.js9
-rw-r--r--js/bootstrap-modal.js8
2 files changed, 10 insertions, 7 deletions
diff --git a/js/bootstrap-alerts.js b/js/bootstrap-alerts.js
index e27ac64829..4c9c9394d6 100644
--- a/js/bootstrap-alerts.js
+++ b/js/bootstrap-alerts.js
@@ -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 = {
diff --git a/js/bootstrap-modal.js b/js/bootstrap-modal.js
index 54cbad4b11..de972a8aa1 100644
--- a/js/bootstrap-modal.js
+++ b/js/bootstrap-modal.js
@@ -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') ?