mirror of
https://github.com/kiwix/kiwix-js-pwa.git
synced 2025-09-09 20:32:45 -04:00
Embargo Wikivoyage landing page for popovers
This commit is contained in:
parent
038a160d55
commit
e01a1e230c
@ -1587,8 +1587,10 @@ function attachKiwixPopoverCss (doc, dark) {
|
|||||||
*/
|
*/
|
||||||
function attachKiwixPopoverDiv (ev, link, articleBaseUrl, dark) {
|
function attachKiwixPopoverDiv (ev, link, articleBaseUrl, dark) {
|
||||||
// Do not show popover if the user has initiated an article load
|
// Do not show popover if the user has initiated an article load
|
||||||
if (link.articleloading || link.popoverisloading) {
|
if (link.articleloading || link.popoverisloading) return;
|
||||||
// console.debug('Cancelled display of popover because user is loading the underlying article');
|
// Do not show popover if we are on Wikivoyage landing page
|
||||||
|
if (/^wikivoyage/i.test(appstate.selectedArchive.file.name) && (appstate.expectedArticleURLToBeDisplayed === appstate.selectedArchive.landingPageUrl ||
|
||||||
|
appstate.expectedArticleURLToBeDisplayed === 'A/Wikivoyage:Offline_reader_Expedition/Home_page')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
link.popoverisloading = true;
|
link.popoverisloading = true;
|
||||||
@ -1601,6 +1603,8 @@ function attachKiwixPopoverDiv (ev, link, articleBaseUrl, dark) {
|
|||||||
var articleWindow = currentDocument.defaultView;
|
var articleWindow = currentDocument.defaultView;
|
||||||
removeKiwixPopoverDivs(currentDocument);
|
removeKiwixPopoverDivs(currentDocument);
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
|
// Do not show popover if the user has initiated an article load
|
||||||
|
if (link.articleloading) return;
|
||||||
// Check if the link is still being hovered over, and abort display of popover if not
|
// Check if the link is still being hovered over, and abort display of popover if not
|
||||||
if (!linkHref || !link.matches(':hover') && currentDocument.activeElement !== link) return;
|
if (!linkHref || !link.matches(':hover') && currentDocument.activeElement !== link) return;
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user