Skip to content

Commit

Permalink
Merge pull request #11750 from rtibbles/full_screens_for_everyone
Browse files Browse the repository at this point in the history
Removes uncleaned up reference to isAndroidWebview.
  • Loading branch information
rtibbles authored Jan 19, 2024
2 parents a579274 + 5bc2159 commit ce3bacd
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions kolibri/core/assets/src/views/CoreFullscreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
<script>
import ScreenFull from 'screenfull';
import { isAndroidWebView } from 'kolibri.utils.browserInfo';
const fullscreenApiIsSupported = ScreenFull.isEnabled && !isAndroidWebView;
const NORMALIZE_FULLSCREEN_CLASS = 'normalize-fullscreen';
const MIMIC_FULLSCREEN_CLASS = 'mimic-fullscreen';
Expand All @@ -32,7 +29,7 @@
computed: {
fullscreenClass() {
if (this.isInFullscreen) {
return fullscreenApiIsSupported ? NORMALIZE_FULLSCREEN_CLASS : MIMIC_FULLSCREEN_CLASS;
return ScreenFull.isEnabled ? NORMALIZE_FULLSCREEN_CLASS : MIMIC_FULLSCREEN_CLASS;
}
return null;
},
Expand All @@ -46,7 +43,7 @@
},
mounted() {
// Catch the use of the esc key to exit fullscreen
if (fullscreenApiIsSupported) {
if (ScreenFull.isEnabled) {
ScreenFull.onchange(() => {
this.isInFullscreen = ScreenFull.isFullscreen;
});
Expand All @@ -60,13 +57,13 @@
if (!this.toggling) {
let fullScreenPromise;
this.toggling = true;
if (fullscreenApiIsSupported) {
if (ScreenFull.isEnabled) {
fullScreenPromise = ScreenFull.toggle(this.$refs.fullscreen);
} else {
fullScreenPromise = Promise.resolve();
}
fullScreenPromise.then(() => {
this.isInFullscreen = fullscreenApiIsSupported
this.isInFullscreen = ScreenFull.isEnabled
? ScreenFull.isFullscreen
: !this.isInFullscreen;
this.toggling = false;
Expand Down

0 comments on commit ce3bacd

Please sign in to comment.