Fixes #873 Can't leave fullscreen in Chrome (using button)

This commit is contained in:
Albin Larsson 2018-04-05 20:29:01 +02:00
parent f7e242f054
commit 3082d0d128

View File

@ -193,7 +193,7 @@ class Fullscreen {
} else if (!Fullscreen.native) {
toggleFallback.call(this, false);
} else if (!this.prefix) {
document.cancelFullScreen();
(document.cancelFullScreen || document.exitFullscreen).call(document);
} else if (!utils.is.empty(this.prefix)) {
const action = this.prefix === 'moz' ? 'Cancel' : 'Exit';
document[`${this.prefix}${action}${this.name}`]();