1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-25 21:09:06 +02:00

start updating to data- driven js

This commit is contained in:
Jacob Thornton
2011-10-04 21:48:53 -07:00
parent 913338f930
commit a91a407bd6
6 changed files with 80 additions and 52 deletions

View File

@@ -53,7 +53,7 @@
var Alert = function ( content, selector ) {
this.$element = $(content)
.delegate(selector || '.close', 'click', this.close)
.delegate('[data-alert-dismiss]', 'click', this.close)
}
Alert.prototype = {
@@ -62,6 +62,8 @@
var $element = $(this).parent('.alert-message')
e && e.preventDefault()
e && e.stopPropagation()
$element.removeClass('in')
function removeElement () {
@@ -98,7 +100,7 @@
}
$(document).ready(function () {
new Alert($('body'), '.alert-message[data-alert] .close')
new Alert($('body'))
})
})( window.jQuery || window.ender )