Merge pull request #1034 from friday/remove-array-newline-rule

Suggestion: Remove array newline rule
This commit is contained in:
Sam Potts
2018-06-15 15:34:29 +10:00
committed by GitHub
13 changed files with 31 additions and 138 deletions

38
src/js/controls.js vendored
View File

@ -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);