1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-15 10:05:40 +02:00

add getters for Version and Default where applicable

add modal my gawd
This commit is contained in:
fat
2015-05-10 19:45:38 -07:00
parent bbb97a8660
commit ca9c850ebb
29 changed files with 1114 additions and 1153 deletions

19
js/dist/collapse.js vendored
View File

@@ -25,7 +25,7 @@ var Collapse = (function ($) {
var JQUERY_NO_CONFLICT = $.fn[NAME];
var TRANSITION_DURATION = 600;
var Defaults = {
var Default = {
toggle: true,
parent: null
};
@@ -67,7 +67,7 @@ var Collapse = (function ($) {
this._isTransitioning = false;
this._element = element;
this._config = $.extend({}, Defaults, config);
this._config = $.extend({}, Default, config);
this._triggerArray = $.makeArray($('[data-toggle="collapse"][href="#' + element.id + '"],' + ('[data-toggle="collapse"][data-target="#' + element.id + '"]')));
this._parent = this._config.parent ? this._getParent() : null;
@@ -252,6 +252,19 @@ var Collapse = (function ($) {
}
}
}], [{
key: 'VERSION',
// getters
get: function () {
return VERSION;
}
}, {
key: 'Default',
get: function () {
return Default;
}
}, {
key: '_getTargetFromElement',
// static
@@ -266,7 +279,7 @@ var Collapse = (function ($) {
return this.each(function () {
var $this = $(this);
var data = $this.data(DATA_KEY);
var _config = $.extend({}, Defaults, $this.data(), typeof config === 'object' && config);
var _config = $.extend({}, Default, $this.data(), typeof config === 'object' && config);
if (!data && _config.toggle && /show|hide/.test(config)) {
_config.toggle = false;