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:
6
js/bootstrap-alerts.js
vendored
6
js/bootstrap-alerts.js
vendored
@@ -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 )
|
Reference in New Issue
Block a user