| Total Complexity | 6 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import Feature from 'src/helper/feature.helper'; |
||
| 13 | export default class BootstrapUtil { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Initialize Tooltip plugin everywhere |
||
| 17 | * @see https://getbootstrap.com/docs/4.3/components/tooltips/#example-enable-tooltips-everywhere |
||
| 18 | */ |
||
| 19 | static initTooltip() { |
||
| 20 | /** @deprecated tag:v6.5.0 - Bootstrap v5 uses native elements to init Tooltip plugin */ |
||
| 21 | if (Feature.isActive('v6.5.0.0')) { |
||
| 22 | return new bootstrap.Tooltip(document.body, { |
||
|
|
|||
| 23 | selector: TOOLTIP_SELECTOR, |
||
| 24 | }); |
||
| 25 | } else { |
||
| 26 | $('body').tooltip({ |
||
| 27 | selector: TOOLTIP_SELECTOR, |
||
| 28 | }); |
||
| 29 | } |
||
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Initialize Popover plugin everywhere |
||
| 34 | * @see https://getbootstrap.com/docs/4.3/components/popovers/#example-enable-popovers-everywhere |
||
| 35 | */ |
||
| 36 | static initPopover() { |
||
| 37 | /** @deprecated tag:v6.5.0 - Bootstrap v5 uses native elements to init Popover plugin */ |
||
| 38 | if (Feature.isActive('v6.5.0.0')) { |
||
| 39 | new bootstrap.Popover(document.body, { |
||
| 40 | selector: POPOVER_SELECTOR, |
||
| 41 | trigger: 'focus', |
||
| 42 | }); |
||
| 43 | } else { |
||
| 44 | $('body').popover({ |
||
| 45 | selector: POPOVER_SELECTOR, |
||
| 46 | trigger: 'focus', |
||
| 47 | }); |
||
| 48 | } |
||
| 49 | } |
||
| 50 | |||
| 51 | static initBootstrapPlugins() { |
||
| 52 | this.initTooltip(); |
||
| 53 | this.initPopover(); |
||
| 54 | } |
||
| 55 | } |
||
| 56 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.