HomePhabricator

Detect whether NavPopups gadget is enabled before showing a hovercard

Description

Detect whether NavPopups gadget is enabled before showing a hovercard

Before this change we only used to check whether NavPopups gadget is
enabled once per page load. The premise was that we could figure out
whether the gadget was enabled easily given the module name. Since
the gadget module name can be different on diffirent wikis, that
solution would not scale.

With this change we check whether the gadget is enabled before each
hover over an eligible link. We rely on the existence of the global
window.pg object. The existence of the object means that the
gadget is enabled, thus we do not show Hovercards.

Bug: T135628
Change-Id: Ica154dd3bfd913202a8b558ea4b10ad177176f83

Details

Provenance
bmansurovAuthored on Jun 7 2016, 8:05 AM
Parents
rEPOP7975fde74520: Remove the need for global `mw.popups.triggers`
Branches
Unknown
Tags
Unknown
References
refs/changes/44/292744/4
ChangeId
Ica154dd3bfd913202a8b558ea4b10ad177176f83