Skip to content

Commit

Permalink
Fix #125
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-t committed Feb 26, 2021
1 parent 66b2fb4 commit 299d29b
Show file tree
Hide file tree
Showing 6 changed files with 2,704 additions and 14 deletions.
14 changes: 11 additions & 3 deletions dist/js/chocolat.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class Chocolat {
}

if (this.settings.fullScreen) {
this.state.fullScreenOpen = openFullScreen(this.elems.wrapper);
openFullScreen(this.elems.wrapper);
}

if (this.settings.currentImageIndex === index) {
Expand Down Expand Up @@ -429,7 +429,7 @@ class Chocolat {
}

if (this.state.fullScreenOpen) {
this.state.fullScreenOpen = exitFullScreen();
exitFullScreen();
}

this.settings.currentImageIndex = undefined;
Expand Down Expand Up @@ -542,7 +542,15 @@ class Chocolat {
});
this.off(document, 'fullscreenchange.chocolat');
this.on(document, 'fullscreenchange.chocolat', () => {
if (document.fullscreenElement) {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
}
});
this.off(document, 'webkitfullscreenchange.chocolat');
this.on(document, 'webkitfullscreenchange.chocolat', () => {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
Expand Down
14 changes: 11 additions & 3 deletions dist/js/chocolat.esm.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class Chocolat {
}

if (this.settings.fullScreen) {
this.state.fullScreenOpen = openFullScreen(this.elems.wrapper);
openFullScreen(this.elems.wrapper);
}

if (this.settings.currentImageIndex === index) {
Expand Down Expand Up @@ -427,7 +427,7 @@ class Chocolat {
}

if (this.state.fullScreenOpen) {
this.state.fullScreenOpen = exitFullScreen();
exitFullScreen();
}

this.settings.currentImageIndex = undefined;
Expand Down Expand Up @@ -540,7 +540,15 @@ class Chocolat {
});
this.off(document, 'fullscreenchange.chocolat');
this.on(document, 'fullscreenchange.chocolat', () => {
if (document.fullscreenElement) {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
}
});
this.off(document, 'webkitfullscreenchange.chocolat');
this.on(document, 'webkitfullscreenchange.chocolat', () => {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
Expand Down
14 changes: 11 additions & 3 deletions dist/js/chocolat.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@
}

if (this.settings.fullScreen) {
this.state.fullScreenOpen = openFullScreen(this.elems.wrapper);
openFullScreen(this.elems.wrapper);
}

if (this.settings.currentImageIndex === index) {
Expand Down Expand Up @@ -430,7 +430,7 @@
}

if (this.state.fullScreenOpen) {
this.state.fullScreenOpen = exitFullScreen();
exitFullScreen();
}

this.settings.currentImageIndex = undefined;
Expand Down Expand Up @@ -543,7 +543,15 @@
});
this.off(document, 'fullscreenchange.chocolat');
this.on(document, 'fullscreenchange.chocolat', () => {
if (document.fullscreenElement) {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
}
});
this.off(document, 'webkitfullscreenchange.chocolat');
this.on(document, 'webkitfullscreenchange.chocolat', () => {
if (document.fullscreenElement || document.webkitCurrentFullScreenElement || document.webkitFullscreenElement) {
this.state.fullScreenOpen = true;
} else {
this.state.fullScreenOpen = false;
Expand Down
Loading

0 comments on commit 299d29b

Please sign in to comment.