ender-bootstrap-alert
Advanced tools
+27
-31
| /* ========================================================== | ||
| * bootstrap-alert.js v2.0.2 | ||
| * bootstrap-alert.js v2.0.3 | ||
| * http://twitter.github.com/bootstrap/javascript.html#alerts | ||
@@ -21,6 +21,7 @@ * ========================================================== | ||
| !function( $ ){ | ||
| !function ($) { | ||
| "use strict" | ||
| "use strict"; // jshint ;_; | ||
| /* ALERT CLASS DEFINITION | ||
@@ -30,42 +31,37 @@ * ====================== */ | ||
| var dismiss = '[data-dismiss="alert"]' | ||
| , Alert = function ( el ) { | ||
| , Alert = function (el) { | ||
| $(el).on('click', dismiss, this.close) | ||
| } | ||
| Alert.prototype = { | ||
| Alert.prototype.close = function (e) { | ||
| var $this = $(this) | ||
| , selector = $this.attr('data-target') | ||
| , $parent | ||
| constructor: Alert | ||
| if (!selector) { | ||
| selector = $this.attr('href') | ||
| selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 | ||
| } | ||
| , close: function ( e ) { | ||
| var $this = $(this) | ||
| , selector = $this.attr('data-target') | ||
| , $parent | ||
| $parent = $(selector) | ||
| if (!selector) { | ||
| selector = $this.attr('href') | ||
| selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 | ||
| } | ||
| e && e.preventDefault() | ||
| $parent = $(selector) | ||
| $parent.trigger('close') | ||
| $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) | ||
| e && e.preventDefault() | ||
| $parent.trigger(e = $.Event('close')) | ||
| $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) | ||
| if (false) return | ||
| $parent.removeClass('in') | ||
| function removeElement() { | ||
| $parent | ||
| .trigger('close') | ||
| .removeClass('in') | ||
| function removeElement() { | ||
| $parent | ||
| .trigger('closed') | ||
| .remove() | ||
| } | ||
| $.support.transition && $parent.hasClass('fade') ? | ||
| $parent.on($.support.transition.end, removeElement) : | ||
| removeElement() | ||
| .trigger('closed') | ||
| .remove() | ||
| } | ||
| $.support.transition && $parent.hasClass('fade') ? | ||
| $parent.on($.support.transition.end, removeElement) : | ||
| removeElement() | ||
| } | ||
@@ -77,3 +73,3 @@ | ||
| $.fn.alert = function ( option ) { | ||
| $.fn.alert = function (option) { | ||
| return this.each(function () { | ||
@@ -80,0 +76,0 @@ var $this = $(this) |
+3
-3
@@ -16,7 +16,7 @@ { | ||
| "dependencies": { | ||
| "ender-bootstrap-base": "2.0.2", | ||
| "ender-bootstrap-transition": "2.0.2" | ||
| "ender-bootstrap-base": "2.0.3", | ||
| "ender-bootstrap-transition": "2.0.3" | ||
| }, | ||
| "main": "alert.js", | ||
| "version": "2.0.2" | ||
| "version": "2.0.3" | ||
| } |
2865
-2.29%65
-5.8%+ Added
+ Added
- Removed
- Removed
- Removed
Updated