diff options
Diffstat (limited to 'app/assets/javascripts/tooltips')
-rw-r--r-- | app/assets/javascripts/tooltips/index.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/assets/javascripts/tooltips/index.js b/app/assets/javascripts/tooltips/index.js index debb36dc53f..9f5dce4183c 100644 --- a/app/assets/javascripts/tooltips/index.js +++ b/app/assets/javascripts/tooltips/index.js @@ -1,6 +1,6 @@ import Vue from 'vue'; import jQuery from 'jquery'; -import { toArray, isFunction } from 'lodash'; +import { toArray, isFunction, isElement } from 'lodash'; import Tooltips from './components/tooltips.vue'; let app; @@ -54,7 +54,11 @@ const handleTooltipEvent = (rootTarget, e, selector, config = {}) => { } }; -const applyToElements = (elements, handler) => toArray(elements).forEach(handler); +const applyToElements = (elements, handler) => { + const iterable = isElement(elements) ? [elements] : toArray(elements); + + toArray(iterable).forEach(handler); +}; const invokeBootstrapApi = (elements, method) => { if (isFunction(elements.tooltip)) { |