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

refactor dropdown in accordance with readme

This commit is contained in:
Jacob Thornton
2011-11-24 19:40:25 -08:00
parent 71654cbf69
commit 69372701cf
4 changed files with 69 additions and 93 deletions

View File

@@ -26,7 +26,7 @@
* ====================== */
var dismiss = '[data-dismiss="alert"]'
, Alert = function ( el, close ) {
, Alert = function ( el ) {
$(el).delegate(dismiss, 'click', this.close)
}
@@ -36,7 +36,6 @@
var $element = $(this)
$element = $element.hasClass('alert-message') ? $element : $element.parent()
e && e.preventDefault()
$element.removeClass('in')
@@ -55,12 +54,12 @@
/* ALERT PLUGIN DEFINITION
* ======================= */
$.fn.alert = function ( options ) {
$.fn.alert = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('alert')
if (!data) $this.data('alert', (data = new Alert(this)))
if (typeof options == 'string') data[options].call($this)
if (typeof option == 'string') data[option].call($this)
})
}