0
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-01-30 22:52:24 +01:00

Partially backport #32217 (#32225)

Remove unnecessary `_getCustomClass` method.

`customClass` will be in the configuration already, even if it is provided in the data attributes, and jQuery's [`addClass()`](https://api.jquery.com/addclass/) method will handle it, either `this.config.customClass` is a function or a class name (even if it is a blank string).

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Rohit Sharma 2020-11-25 13:05:36 +05:30 committed by GitHub
parent 22168e9b15
commit 8e59752ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,7 +286,7 @@ class Tooltip {
this._popper = new Popper(this.element, tip, this._getPopperConfig(attachment))
$(tip).addClass(CLASS_NAME_SHOW)
$(tip).addClass(this._getCustomClass())
$(tip).addClass(this.config.customClass)
// If this is a touch-enabled device we add extra
// empty mouseover listeners to the body's immediate children;
@ -734,10 +734,6 @@ class Tooltip {
this.config.animation = initConfigAnimation
}
_getCustomClass() {
return this.element.getAttribute('data-custom-class') || this.config.customClass
}
// Static
static _jQueryInterface(config) {