Add app.fullscreen module to handle virtual "fullscreen" of app content
This commit is contained in:
parent
ac4a4ac715
commit
76b6787c60
|
@ -245,6 +245,21 @@ app.post = {
|
|||
},
|
||||
}
|
||||
|
||||
app.fullscreen = {
|
||||
enable: function() {
|
||||
const el = document.querySelector('main');
|
||||
el.classList.add('absolute-top');
|
||||
el.classList.add('width-max');
|
||||
document.querySelector('header').style.display = 'none';
|
||||
},
|
||||
disable: function() {
|
||||
const el = document.querySelector('main');
|
||||
el.classList.remove('absolute-top');
|
||||
el.classList.remove('width-max');
|
||||
document.querySelector('header').removeAttribute('style');
|
||||
},
|
||||
}
|
||||
|
||||
app.media = {
|
||||
view: function(url) {
|
||||
if (url.match(/^.*\.(jpg|jpeg|png|ico|webp)$/))
|
||||
|
@ -484,6 +499,7 @@ window.onhashchange = function(e) {
|
|||
args = [];
|
||||
|
||||
app.overlay.hideAll();
|
||||
app.fullscreen.disable();
|
||||
for (var i = 0; i < app.hashHandlers.length; i++) {
|
||||
const cfg = app.hashHandlers[i];
|
||||
if (cfg.exact !== undefined &&
|
||||
|
|
|
@ -13,6 +13,7 @@ app.pages.quiz = {
|
|||
}
|
||||
}
|
||||
|
||||
app.fullscreen.enable();
|
||||
const container = document.getElementById('app-container');
|
||||
container.innerHTML = '';
|
||||
|
||||
|
|
Loading…
Reference in New Issue