diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-05-11 10:49:30 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-11 10:49:30 +0300 |
commit | 9fe36edf683af02574bf6bbd6c9b27de93bd31b1 (patch) | |
tree | 111d2b788e990a58277ff4543cfd44c5815ac795 /js/src/util | |
parent | 7647b8fe5b77120ba319e7119bb0515d91f734da (diff) |
Extract static `DATA_KEY` & `EVENT_KEY` to base-component (#33635)
* Force each plugin that extends base-components to implement a static method `NAME()`
* Remove redundant `NAME` argument from 'Utils.defineJQueryPlugin' & fix test
Diffstat (limited to 'js/src/util')
-rw-r--r-- | js/src/util/index.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/js/src/util/index.js b/js/src/util/index.js index a5144f15e4..0dd6b1d454 100644 --- a/js/src/util/index.js +++ b/js/src/util/index.js @@ -214,11 +214,12 @@ const onDOMContentLoaded = callback => { const isRTL = () => document.documentElement.dir === 'rtl' -const defineJQueryPlugin = (name, plugin) => { +const defineJQueryPlugin = plugin => { onDOMContentLoaded(() => { const $ = getjQuery() /* istanbul ignore if */ if ($) { + const name = plugin.NAME const JQUERY_NO_CONFLICT = $.fn[name] $.fn[name] = plugin.jQueryInterface $.fn[name].Constructor = plugin |