Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfat <fat@folders.local>2015-05-13 22:48:34 +0300
committerfat <fat@folders.local>2015-05-13 22:48:34 +0300
commitf8b2569ec8956a1f4d09fe6fc9865bd200ecde43 (patch)
tree190263c441212d1ba91507d385fe3e6bc33e2614 /js/dist/alert.js
parentdafdd180cd54a2e238fe715d8aeb83c07f385a18 (diff)
implement global dispose method
Diffstat (limited to 'js/dist/alert.js')
-rw-r--r--js/dist/alert.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/dist/alert.js b/js/dist/alert.js
index 63b7012b69..876a5f3d04 100644
--- a/js/dist/alert.js
+++ b/js/dist/alert.js
@@ -22,6 +22,8 @@ var Alert = (function ($) {
var NAME = 'alert';
var VERSION = '4.0.0';
var DATA_KEY = 'bs.alert';
+ var EVENT_KEY = '.' + DATA_KEY;
+ var DATA_API_KEY = '.data-api';
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 150;
@@ -30,9 +32,9 @@ var Alert = (function ($) {
};
var Event = {
- CLOSE: 'close.bs.alert',
- CLOSED: 'closed.bs.alert',
- CLICK: 'click.bs.alert.data-api'
+ CLOSE: 'close' + EVENT_KEY,
+ CLOSED: 'closed' + EVENT_KEY,
+ CLICK_DATA_API: 'click' + EVENT_KEY + '' + DATA_API_KEY
};
var ClassName = {
@@ -72,6 +74,12 @@ var Alert = (function ($) {
this._removeElement(rootElement);
}
}, {
+ key: 'dispose',
+ value: function dispose() {
+ $.removeData(this._element, DATA_KEY);
+ this._element = null;
+ }
+ }, {
key: '_getRootElement',
// private
@@ -164,7 +172,7 @@ var Alert = (function ($) {
* ------------------------------------------------------------------------
*/
- $(document).on(Event.CLICK, Selector.DISMISS, Alert._handleDismiss(new Alert()));
+ $(document).on(Event.CLICK_DATA_API, Selector.DISMISS, Alert._handleDismiss(new Alert()));
/**
* ------------------------------------------------------------------------