Skip to content

Commit

Permalink
Fixed linting problems.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickyc975 committed Sep 23, 2020
1 parent 77df3f3 commit 07a34f0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion web/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
AutoPrintRegExp,
DEFAULT_SCALE_VALUE,
EventBus,
getActiveOrFocusedElement,
getPDFFileNameFromURL,
isValidRotation,
isValidScrollMode,
Expand All @@ -34,7 +35,6 @@ import {
ScrollMode,
SpreadMode,
TextLayerMode,
getActiveOrFocusedElement,
} from "./ui_utils.js";
import { AppOptions, OptionKind } from "./app_options.js";
import {
Expand Down
9 changes: 6 additions & 3 deletions web/ui_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,8 @@ function moveToEndOfArray(arr, condition) {
/**
* Get the active or focused element in current DOM.
*
* Recursively search for the truly active or focused element incase there are shadow DOMs.
* Recursively search for the truly active or focused element incase there are
* shadow DOMs.
*
* @author Chen Jinlong <[email protected]>
*
Expand All @@ -998,11 +999,13 @@ function moveToEndOfArray(arr, condition) {
*/
function getActiveOrFocusedElement(root) {
let curRoot = root || document;
let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
let curActiveOrFocused =
curRoot.activeElement || curRoot.querySelector(":focus");

while (curActiveOrFocused && curActiveOrFocused.shadowRoot) {
curRoot = curActiveOrFocused.shadowRoot;
curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
curActiveOrFocused =
curRoot.activeElement || curRoot.querySelector(":focus");
}

return curActiveOrFocused;
Expand Down

0 comments on commit 07a34f0

Please sign in to comment.