mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-09-08 12:56:45 +00:00
Merge pull request #730 from mouse-reeve/js-style
JS linting and whitespace fixes
This commit is contained in:
commit
efcb552f9a
1 changed files with 203 additions and 203 deletions
|
@ -301,7 +301,7 @@ class TabGroup {
|
||||||
case this.keys.down:
|
case this.keys.down:
|
||||||
this.determineOrientation(event);
|
this.determineOrientation(event);
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle keyup on tabs
|
// Handle keyup on tabs
|
||||||
|
@ -313,7 +313,7 @@ class TabGroup {
|
||||||
case this.keys.right:
|
case this.keys.right:
|
||||||
this.determineOrientation(event);
|
this.determineOrientation(event);
|
||||||
break;
|
break;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// When a tablist’s aria-orientation is set to vertical,
|
// When a tablist’s aria-orientation is set to vertical,
|
||||||
|
@ -328,17 +328,17 @@ class TabGroup {
|
||||||
if (key === this.keys.up || key === this.keys.down) {
|
if (key === this.keys.up || key === this.keys.down) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
proceed = true;
|
proceed = true;
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (key === this.keys.left || key === this.keys.right) {
|
if (key === this.keys.left || key === this.keys.right) {
|
||||||
proceed = true;
|
proceed = true;
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
if (proceed) {
|
if (proceed) {
|
||||||
this.switchTabOnArrowPress(event);
|
this.switchTabOnArrowPress(event);
|
||||||
};
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Either focus the next, previous, first, or last tab
|
// Either focus the next, previous, first, or last tab
|
||||||
|
@ -348,7 +348,7 @@ class TabGroup {
|
||||||
|
|
||||||
for (let button of this.buttons) {
|
for (let button of this.buttons) {
|
||||||
button.addEventListener('focus', this.focusEventHandler.bind(this));
|
button.addEventListener('focus', this.focusEventHandler.bind(this));
|
||||||
};
|
}
|
||||||
|
|
||||||
if (this.direction[pressed]) {
|
if (this.direction[pressed]) {
|
||||||
var target = event.target;
|
var target = event.target;
|
||||||
|
@ -434,8 +434,8 @@ class TabGroup {
|
||||||
else {
|
else {
|
||||||
// If no value is specified, default to 300ms
|
// If no value is specified, default to 300ms
|
||||||
delay = 300;
|
delay = 300;
|
||||||
};
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
return delay;
|
return delay;
|
||||||
}
|
}
|
||||||
|
@ -444,7 +444,7 @@ class TabGroup {
|
||||||
var target = event.target;
|
var target = event.target;
|
||||||
|
|
||||||
setTimeout(this.checkTabFocus.bind(this), this.delay, target);
|
setTimeout(this.checkTabFocus.bind(this), this.delay, target);
|
||||||
};
|
}
|
||||||
|
|
||||||
// Only activate tab on focus if it still has focus after the delay
|
// Only activate tab on focus if it still has focus after the delay
|
||||||
checkTabFocus(target) {
|
checkTabFocus(target) {
|
||||||
|
|
Loading…
Reference in a new issue