aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/controls.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2018-06-15 15:34:29 +1000
committerGitHub <noreply@github.com>2018-06-15 15:34:29 +1000
commitd522e405942e060180c7f5b28c914028e94a917b (patch)
tree71986987e1c10eca00d6796551b2f065f9d07d03 /src/js/controls.js
parent3cd2b9a6c3ab2a7b530f1f0e6eae884ba41b9211 (diff)
parent6bff6b317d6adcd9f94c8d4d8ee225d39f784e0f (diff)
downloadplyr-d522e405942e060180c7f5b28c914028e94a917b.tar.lz
plyr-d522e405942e060180c7f5b28c914028e94a917b.tar.xz
plyr-d522e405942e060180c7f5b28c914028e94a917b.zip
Merge pull request #1034 from friday/remove-array-newline-rule
Suggestion: Remove array newline rule
Diffstat (limited to 'src/js/controls.js')
-rw-r--r--src/js/controls.js38
1 files changed, 7 insertions, 31 deletions
diff --git a/src/js/controls.js b/src/js/controls.js
index e601a03a..f091555f 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;
}
@@ -1406,10 +1392,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);
});
@@ -1457,16 +1440,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);