Skip to content

Commit

Permalink
refactor: address new linter errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dulli committed Sep 12, 2023
1 parent be24b69 commit 89940b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/plugins/pdfPlayer/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ export class PdfPlayer {
this.bindMediaElementEvents();

document.addEventListener('keyup', this.onWindowKeyUp);
screen.orientation.addEventListener("change", this.onScreenResize);
if ('screen' in window) window.screen.orientation.addEventListener('change', this.onScreenResize);
else document.addEventListener('orientationchange', this.onScreenResize);
}

unbindMediaElementEvents() {
Expand All @@ -169,7 +170,8 @@ export class PdfPlayer {
}

document.removeEventListener('keyup', this.onWindowKeyUp);
screen.orientation.removeEventListener("change", this.onScreenResize);
if ('screen' in window) window.screen.orientation.removeEventListener('change', this.onScreenResize);
else document.removeEventListener('orientationchange', this.onScreenResize);
}

createMediaElement() {
Expand Down Expand Up @@ -258,7 +260,7 @@ export class PdfPlayer {
}

reloadPage() {
this.loadPage(this.progress + 1)
this.loadPage(this.progress + 1);
}

setPage(pageNumber) {
Expand Down
7 changes: 6 additions & 1 deletion src/plugins/pdfPlayer/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
width: 100vw;
overflow: scroll;

// stylelint has a problem with the selector order
// but grouping it this way simply makes the most sense
// so we turn it off for this block:
/* stylelint-disable no-descending-specificity */
&.fullPage {
display: flex !important;
align-items: center;
Expand All @@ -28,7 +32,7 @@
max-width: 100% !important;
}
}

&:not(.fullPage) {
canvas {
max-height: 150vmax;
Expand All @@ -39,6 +43,7 @@
max-width: 150vmax !important;
}
}
/* stylelint-enable no-descending-specificity */
}

.actionButtons {
Expand Down

0 comments on commit 89940b6

Please sign in to comment.