aboutsummaryrefslogtreecommitdiffstats
path: root/demo/src/js/tab-focus.js
diff options
context:
space:
mode:
authorSam Potts <sam@potts.es>2020-04-24 00:32:16 +1000
committerSam Potts <sam@potts.es>2020-04-24 00:32:16 +1000
commit3b521f73bd773dcb530746db47c90dbb1349b70b (patch)
tree371bb120c654d55d0016792b9412fc122735c1b8 /demo/src/js/tab-focus.js
parent27126b20bc5d2a3a8947c363d1f1887533f69688 (diff)
parent68137aa789b195b26d4306eaebc7fee2f8eb3374 (diff)
downloadplyr-3b521f73bd773dcb530746db47c90dbb1349b70b.tar.lz
plyr-3b521f73bd773dcb530746db47c90dbb1349b70b.tar.xz
plyr-3b521f73bd773dcb530746db47c90dbb1349b70b.zip
Merge branch 'develop' of github.com:sampotts/plyr into develop
# Conflicts: # package.json # yarn.lock
Diffstat (limited to 'demo/src/js/tab-focus.js')
-rw-r--r--demo/src/js/tab-focus.js32
1 files changed, 16 insertions, 16 deletions
diff --git a/demo/src/js/tab-focus.js b/demo/src/js/tab-focus.js
index c1602cf0..b13049bc 100644
--- a/demo/src/js/tab-focus.js
+++ b/demo/src/js/tab-focus.js
@@ -4,28 +4,28 @@ const tabClassName = 'tab-focus';
// Remove class on blur
document.addEventListener('focusout', event => {
- if (!event.target.classList || container.contains(event.target)) {
- return;
- }
+ if (!event.target.classList || container.contains(event.target)) {
+ return;
+ }
- event.target.classList.remove(tabClassName);
+ event.target.classList.remove(tabClassName);
});
// Add classname to tabbed elements
document.addEventListener('keydown', event => {
- if (event.keyCode !== 9) {
- return;
- }
+ if (event.keyCode !== 9) {
+ return;
+ }
- // Delay the adding of classname until the focus has changed
- // This event fires before the focusin event
- setTimeout(() => {
- const focused = document.activeElement;
+ // Delay the adding of classname until the focus has changed
+ // This event fires before the focusin event
+ setTimeout(() => {
+ const focused = document.activeElement;
- if (!focused || !focused.classList || container.contains(focused)) {
- return;
- }
+ if (!focused || !focused.classList || container.contains(focused)) {
+ return;
+ }
- focused.classList.add(tabClassName);
- }, 10);
+ focused.classList.add(tabClassName);
+ }, 10);
});