diff options
Diffstat (limited to 'src/js/controls.js')
-rw-r--r-- | src/js/controls.js | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/js/controls.js b/src/js/controls.js index 0e28c222..39ddb79c 100644 --- a/src/js/controls.js +++ b/src/js/controls.js @@ -580,10 +580,7 @@ const controls = { // Show/hide the tooltip // If the event is a moues in/out and percentage is inside bounds - if (is.event(event) && [ - 'mouseenter', - 'mouseleave', - ].includes(event.type)) { + if (is.event(event) && ['mouseenter', 'mouseleave'].includes(event.type)) { toggle(event.type === 'mouseenter'); } }, @@ -888,15 +885,7 @@ const controls = { if (is.array(options)) { this.options.speed = options; } else if (this.isHTML5 || this.isVimeo) { - this.options.speed = [ - 0.5, - 0.75, - 1, - 1.25, - 1.5, - 1.75, - 2, - ]; + this.options.speed = [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2]; } // Set options if passed and filter based on config @@ -1054,10 +1043,7 @@ const controls = { // Restore auto height/width const restore = e => { // We're only bothered about height and width on the container - if (e.target !== container || ![ - 'width', - 'height', - ].includes(e.propertyName)) { + if (e.target !== container || !['width', 'height'].includes(e.propertyName)) { return; } @@ -1404,10 +1390,7 @@ const controls = { const replace = input => { let result = input; - Object.entries(props).forEach(([ - key, - value, - ]) => { + Object.entries(props).forEach(([key, value]) => { result = replaceAll(result, `{${key}}`, value); }); @@ -1455,16 +1438,9 @@ const controls = { // Setup tooltips if (this.config.tooltips.controls) { - const labels = getElements.call( - this, - [ - this.config.selectors.controls.wrapper, - ' ', - this.config.selectors.labels, - ' .', - this.config.classNames.hidden, - ].join(''), - ); + const { classNames, selectors } = this.config; + const selector = `${selectors.controls.wrapper} ${selectors.labels} .${classNames.hidden}`; + const labels = getElements.call(this, selector); Array.from(labels).forEach(label => { toggleClass(label, this.config.classNames.hidden, false); |