Skip to content

Commit

Permalink
fix(fullscreen): updated css selector
Browse files Browse the repository at this point in the history
updated css selector in fullscreen option and made it a little better looking.
  • Loading branch information
jewdev committed Dec 22, 2024
1 parent db570ff commit eb3cf70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions packed.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,9 @@ window.plus_main = () => {


class FullscreenHook extends Hook {
CSSselector = 'div[id="app"]>div>div>div[tabindex="-1"]';
FULLSCREEN_CSS = `
div[id="app"]>div>div[tabindex="-1"] {
${this.CSSselector} {
min-width: 100% !important;
height: 100% !important;
top: 0 !important;
Expand Down Expand Up @@ -457,7 +458,7 @@ window.plus_main = () => {
}

apply_fullscreen() {
const targetElement = document.querySelector('div[id="app"]>div>div[tabindex="-1"]');
const targetElement = document.querySelector(this.CSSselector);
if (targetElement) {
if (!this.style) {
this.style = document.createElement('style');
Expand Down
5 changes: 3 additions & 2 deletions scripts/fullscreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
class FullscreenHook extends Hook {
CSSselector = 'div[id="app"]>div>div>div[tabindex="-1"]';
FULLSCREEN_CSS = `
div[id="app"]>div>div[tabindex="-1"] {
${this.CSSselector} {
min-width: 100% !important;
height: 100% !important;
top: 0 !important;
Expand Down Expand Up @@ -42,7 +43,7 @@ class FullscreenHook extends Hook {
}

apply_fullscreen() {
const targetElement = document.querySelector('div[id="app"]>div>div[tabindex="-1"]');
const targetElement = document.querySelector(this.CSSselector);
if (targetElement) {
if (!this.style) {
this.style = document.createElement('style');
Expand Down

0 comments on commit eb3cf70

Please sign in to comment.