Skip to content

Commit

Permalink
fix: repair fullscreen element detection with Firefox
Browse files Browse the repository at this point in the history
Rename getFullscreenElement to fullscreenElement.

Fixes #1878.
  • Loading branch information
kslimani authored and towerz committed Dec 3, 2019
1 parent 0f71dde commit 1da4afd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/components/core/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,8 @@ export default class Core extends UIObject {
}

isFullscreen() {
return Fullscreen.getFullscreenElement() === (Browser.isiOS ? this.activeContainer.el : this.el)
// Ensure current instance is in fullscreen mode by checking fullscreen element
return Fullscreen.fullscreenElement() === (Browser.isiOS ? this.activeContainer.el : this.el)
}

toggleFullscreen() {
Expand Down
8 changes: 4 additions & 4 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ export function formatTime(time, paddedHours) {
}

export const Fullscreen = {
getFullscreenElement: function() {
return document.webkitFullscreenElement ||
document.webkitIsFullScreen ||
document.mozFullScreen ||
fullscreenElement: function() {
return document.fullscreenElement ||
document.webkitFullscreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement
},
requestFullscreen: function(el) {
Expand Down

0 comments on commit 1da4afd

Please sign in to comment.