diff options
| author | Jacob Thornton <[email protected]> | 2011-11-20 20:58:04 -0800 |
|---|---|---|
| committer | Jacob Thornton <[email protected]> | 2011-11-20 20:58:04 -0800 |
| commit | bc65b58551575c9dfb2e4d9f4f7af97009e39432 (patch) | |
| tree | cb27a6f15bfdd7650871f6f6aa5aba496201bd29 /js/bootstrap-alerts.js | |
| parent | 0b1d5d9189ea82cde5e848e5a8771a8f4850e21f (diff) | |
| download | bootstrap-bc65b58551575c9dfb2e4d9f4f7af97009e39432.tar.xz bootstrap-bc65b58551575c9dfb2e4d9f4f7af97009e39432.zip | |
merge in js from 1.4... start working through js docs
Diffstat (limited to 'js/bootstrap-alerts.js')
| -rw-r--r-- | js/bootstrap-alerts.js | 44 |
1 files changed, 5 insertions, 39 deletions
diff --git a/js/bootstrap-alerts.js b/js/bootstrap-alerts.js index 3ef1672bc..600440e40 100644 --- a/js/bootstrap-alerts.js +++ b/js/bootstrap-alerts.js @@ -1,5 +1,5 @@ /* ========================================================== - * bootstrap-alerts.js v1.4.0 + * bootstrap-alerts.js v2.0.0 * http://twitter.github.com/bootstrap/javascript.html#alerts * ========================================================== * Copyright 2011 Twitter, Inc. @@ -22,34 +22,6 @@ "use strict" - /* CSS TRANSITION SUPPORT (https://gist.github.com/373874) - * ======================================================= */ - - var transitionEnd - - $(document).ready(function () { - - $.support.transition = (function () { - var thisBody = document.body || document.documentElement - , thisStyle = thisBody.style - , support = thisStyle.transition !== undefined || thisStyle.WebkitTransition !== undefined || thisStyle.MozTransition !== undefined || thisStyle.MsTransition !== undefined || thisStyle.OTransition !== undefined - return support - })() - - // set CSS transition event type - if ( $.support.transition ) { - transitionEnd = "TransitionEnd" - if ( $.browser.webkit ) { - transitionEnd = "webkitTransitionEnd" - } else if ( $.browser.mozilla ) { - transitionEnd = "transitionend" - } else if ( $.browser.opera ) { - transitionEnd = "oTransitionEnd" - } - } - - }) - /* ALERT CLASS DEFINITION * ====================== */ @@ -76,7 +48,7 @@ } $.support.transition && $element.hasClass('fade') ? - $element.bind(transitionEnd, removeElement) : + $element.bind($.support.transition.end, removeElement) : removeElement() } @@ -88,10 +60,6 @@ $.fn.alert = function ( options ) { - if ( options === true ) { - return this.data('alert') - } - return this.each(function () { var $this = $(this) , data @@ -112,13 +80,11 @@ } $.fn.alert.defaults = { - selector: '.close' + selector: '[data-dismiss="alert"]' } - $(document).ready(function () { - new Alert($('body'), { - selector: '.alert-message[data-alert] .close' - }) + $(function () { + new Alert( $('body') ) }) }( window.jQuery || window.ender );
\ No newline at end of file |
