2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-05-30 15:24:08 +03:00

Js - use a default JQueryInterface in js components

This commit is contained in:
GeoSot
2021-12-02 18:12:53 +02:00
parent 88a6610895
commit dd9f2b31d0
27 changed files with 161 additions and 239 deletions
-17
View File
@@ -263,23 +263,6 @@ class Tab extends BaseComponent {
_getOuterElement(elem) {
return elem.closest(SELECTOR_OUTER) || elem
}
// Static
static jQueryInterface(config) {
return this.each(function () {
const data = Tab.getOrCreateInstance(this)
if (typeof config !== 'string') {
return
}
if (data[config] === undefined || config.startsWith('_') || config === 'constructor') {
throw new TypeError(`No method named "${config}"`)
}
data[config]()
})
}
}
/**