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
+17 -2
View File
@@ -52,6 +52,14 @@
wrap: true
};
var DefaultType = {
interval: '(number|boolean)',
keyboard: 'boolean',
slide: '(boolean|string)',
pause: '(string|boolean)',
wrap: 'boolean'
};
var Direction = {
NEXT: 'next',
PREVIOUS: 'prev'
@@ -103,7 +111,7 @@
this._isPaused = false;
this._isSliding = false;
this._config = config;
this._config = this._getConfig(config);
this._element = $(element)[0];
this._indicatorsElement = $(this._element).find(Selector.INDICATORS)[0];
@@ -204,10 +212,17 @@
this._indicatorsElement = null;
}
}, {
key: '_addEventListeners',
key: '_getConfig',
// private
value: function _getConfig(config) {
config = $.extend({}, Default, config);
_Util.typeCheckConfig(NAME, config, DefaultType);
return config;
}
}, {
key: '_addEventListeners',
value: function _addEventListeners() {
if (this._config.keyboard) {
$(this._element).on(Event.KEYDOWN, $.proxy(this._keydown, this));