2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-17 19:21:23 +03:00

al tests passing, dist rebuilt, w/typechecker

This commit is contained in:
fat
2015-05-13 14:52:46 -07:00
parent eaab1def7a
commit 6b2b0ed32f
16 changed files with 308 additions and 63 deletions
+16 -3
View File
@@ -46,7 +46,12 @@
var Default = {
toggle: true,
parent: null
parent: ''
};
var DefaultType = {
toggle: 'boolean',
parent: 'string'
};
var Event = {
@@ -86,7 +91,7 @@
this._isTransitioning = false;
this._element = element;
this._config = $.extend({}, Default, config);
this._config = this._getConfig(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;
@@ -247,10 +252,18 @@
this._isTransitioning = null;
}
}, {
key: '_getDimension',
key: '_getConfig',
// private
value: function _getConfig(config) {
config = $.extend({}, Default, config);
config.toggle = !!config.toggle; // coerce string values
_Util.typeCheckConfig(NAME, config, DefaultType);
return config;
}
}, {
key: '_getDimension',
value: function _getDimension() {
var hasWidth = $(this._element).hasClass(Dimension.WIDTH);
return hasWidth ? Dimension.WIDTH : Dimension.HEIGHT;