mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-08-04 03:48:41 -04:00
Fix bug with print icon
This commit is contained in:
parent
b88e5b2e3a
commit
e750fbeec7
@ -1095,11 +1095,13 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'utf8', 'cache', 'images
|
|||||||
|
|
||||||
document.getElementById('btnAbout').addEventListener('click', function () {
|
document.getElementById('btnAbout').addEventListener('click', function () {
|
||||||
var btnAboutElement = document.getElementById('btnAbout');
|
var btnAboutElement = document.getElementById('btnAbout');
|
||||||
|
// Don't allow this button to be clicked if button is being used as exit fullscreen button
|
||||||
|
if (/glyphicon-(fullscreen|resize-small)/.test(btnAboutElement.innerHTML)) return;
|
||||||
|
// Deal with use of button for printing
|
||||||
if (/glyphicon-print/.test(btnAboutElement.innerHTML)) {
|
if (/glyphicon-print/.test(btnAboutElement.innerHTML)) {
|
||||||
printIntercept();
|
printIntercept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (/glyphicon-(fullscreen|resize-small)/.test(btnAboutElement.innerHTML)) return;
|
|
||||||
//Check if we're 'unclicking' the button
|
//Check if we're 'unclicking' the button
|
||||||
var searchDiv = document.getElementById('about');
|
var searchDiv = document.getElementById('about');
|
||||||
if (searchDiv.style.display != 'none') {
|
if (searchDiv.style.display != 'none') {
|
||||||
|
@ -1025,7 +1025,7 @@ define(rqDef, function(util) {
|
|||||||
document.webkitExitFullscreen ? document.webkitExitFullscreen() :
|
document.webkitExitFullscreen ? document.webkitExitFullscreen() :
|
||||||
document.mozCancelFullScreen ? document.mozCancelFullScreen() :
|
document.mozCancelFullScreen ? document.mozCancelFullScreen() :
|
||||||
document.msExitFullscreen ? document.msExitFullscreen() : Promise.reject('No full-screen mode API available');
|
document.msExitFullscreen ? document.msExitFullscreen() : Promise.reject('No full-screen mode API available');
|
||||||
return typeof fn === 'Promise' ? fn : Promise.resolve(fn);
|
return Promise.resolve(fn);
|
||||||
};
|
};
|
||||||
return rq(el).then(function () {
|
return rq(el).then(function () {
|
||||||
console.log(el ? 'Full-screen mode enabled' : 'Full-screen mode disabled');
|
console.log(el ? 'Full-screen mode enabled' : 'Full-screen mode disabled');
|
||||||
@ -1039,7 +1039,7 @@ define(rqDef, function(util) {
|
|||||||
/**
|
/**
|
||||||
* Attempts to put the app into full-screen mode and (if requested) lock the display orientation using the Screen Orientation Lock API
|
* Attempts to put the app into full-screen mode and (if requested) lock the display orientation using the Screen Orientation Lock API
|
||||||
* @param {string} val A valid value in the API, e.g. '', 'natural', 'portrait', 'landscape'
|
* @param {string} val A valid value in the API, e.g. '', 'natural', 'portrait', 'landscape'
|
||||||
* @returns
|
* @returns {Promise<String>} A Promise that resolves to a string informing the result (which may be '')
|
||||||
*/
|
*/
|
||||||
function lockDisplayOrientation(val) {
|
function lockDisplayOrientation(val) {
|
||||||
if (val) {
|
if (val) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user