mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-30 15:29:06 +02:00
add simple type checker implementation
This commit is contained in:
22
js/dist/tooltip.js
vendored
22
js/dist/tooltip.js
vendored
@@ -37,7 +37,20 @@ var Tooltip = (function ($) {
|
||||
selector: false,
|
||||
placement: 'top',
|
||||
offset: '0 0',
|
||||
constraints: null
|
||||
constraints: []
|
||||
};
|
||||
|
||||
var DefaultType = {
|
||||
animation: 'boolean',
|
||||
template: 'string',
|
||||
title: '(string|function)',
|
||||
trigger: 'string',
|
||||
delay: '(number|object)',
|
||||
html: 'boolean',
|
||||
selector: '(string|boolean)',
|
||||
placement: '(string|function)',
|
||||
offset: 'string',
|
||||
constraints: 'array'
|
||||
};
|
||||
|
||||
var AttachmentMap = {
|
||||
@@ -476,6 +489,8 @@ var Tooltip = (function ($) {
|
||||
};
|
||||
}
|
||||
|
||||
Util.typeCheckConfig(NAME, config, this.constructor.DefaultType);
|
||||
|
||||
return config;
|
||||
}
|
||||
}, {
|
||||
@@ -527,6 +542,11 @@ var Tooltip = (function ($) {
|
||||
get: function () {
|
||||
return EVENT_KEY;
|
||||
}
|
||||
}, {
|
||||
key: 'DefaultType',
|
||||
get: function () {
|
||||
return DefaultType;
|
||||
}
|
||||
}, {
|
||||
key: '_jQueryInterface',
|
||||
|
||||
|
Reference in New Issue
Block a user