From 4e258b93526bc68d9e3a9137c112b74a33c9c3de Mon Sep 17 00:00:00 2001 From: Jaifroid Date: Mon, 7 Jun 2021 22:02:46 +0100 Subject: [PATCH] Refine focus to support UWP apps Former-commit-id: 28d36ca19c8d2273a3a156cdb8f5c1eb2c708360 [formerly eeafabdd5ab5525c91e29b42cc05ab48b3bee3e3 [formerly fb2933b9d6cac84d0fbdd2620fe0b7f02ff9465d]] Former-commit-id: cbf35ad957f8e88932b4bb01ab93df0dcedba924 Former-commit-id: bbce0eb68a5fea7c631e84dd385078ac5f904a7e --- www/js/app.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/js/app.js b/www/js/app.js index 7a83d7ef..fe194e5b 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -756,8 +756,10 @@ define(['jquery', 'zimArchiveLoader', 'uiUtil', 'util', 'cache', 'images', 'sett document.getElementById('scrollbox').style.height = 0; document.getElementById('search-article').style.overflowY = 'hidden'; setTimeout(function() { - document.getElementById('articleContent').style.display = 'block'; - document.getElementById('articleContent').focus(); + if (appstate.target === 'iframe') { + if (articleContainer) articleContainer.style.display = 'block'; + if (articleWindow) articleWindow.focus(); + } }, 50); } $("#articleList").empty();