]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Partially backport #32217 (#32225)
authorRohit Sharma <rohit2sharma95@gmail.com>
Wed, 25 Nov 2020 07:35:36 +0000 (13:05 +0530)
committerGitHub <noreply@github.com>
Wed, 25 Nov 2020 07:35:36 +0000 (09:35 +0200)
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>
js/src/tooltip.js

index 0b74eb800d8e45253af76780221ed4413b6eebc8..9a37e73d12050e075352762b9feec83276d2313e 100644 (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) {