diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-06-10 10:53:59 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2021-07-22 17:20:38 +0300 |
commit | 3716603dbc3dc1b612c4ef6c83860195312f2532 (patch) | |
tree | a4a9d74c5de53103b1eb7c4e8a482bdbc8fcb0b3 /js/src/tooltip.js | |
parent | 92c7056619293a581626c37ef2c0095c6f1abceb (diff) |
Use `getOrCreateInstance` on `_initializeOnDelegatedTarget`
Diffstat (limited to 'js/src/tooltip.js')
-rw-r--r-- | js/src/tooltip.js | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/js/src/tooltip.js b/js/src/tooltip.js index d69a80e275..6dc7a0350d 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -439,15 +439,7 @@ class Tooltip extends BaseComponent { // Private _initializeOnDelegatedTarget(event, context) { - const dataKey = this.constructor.DATA_KEY - context = context || Data.get(event.delegateTarget, dataKey) - - if (!context) { - context = new this.constructor(event.delegateTarget, this._getDelegateConfig()) - Data.set(event.delegateTarget, dataKey, context) - } - - return context + return context || this.constructor.getOrCreateInstance(event.delegateTarget, this._getDelegateConfig()) } _getOffset() { |