diff --git a/includes/Components/CitizenComponentPageTools.php b/includes/Components/CitizenComponentPageTools.php index b9888572e..4d36ccb96 100644 --- a/includes/Components/CitizenComponentPageTools.php +++ b/includes/Components/CitizenComponentPageTools.php @@ -154,6 +154,7 @@ public function getTemplateData(): array { */ 'is-uls-ready' => false, 'int-language-count' => $this->numLanguages, + 'is-sharable' => $this->title->exists() && $this->title->isContentPage(), 'msg-citizen-share' => $this->localizer->msg( "citizen-share" )->text() ]; } diff --git a/resources/skins.citizen.scripts/share.js b/resources/skins.citizen.scripts/share.js index 85be716b3..c0d778260 100644 --- a/resources/skins.citizen.scripts/share.js +++ b/resources/skins.citizen.scripts/share.js @@ -4,13 +4,9 @@ * @return {void} */ function init() { - if ( !mw.config.get( 'wgIsArticle' ) ) { - return; - } - const shareButton = document.getElementById( 'citizen-share' ); if ( !shareButton ) { - mw.log.error( '[Citizen] Unable to find share button (#shareButton not found)' ); + // Citizen will not add the citizen-share element if the share button is undesirable return; } diff --git a/templates/PageTools.mustache b/templates/PageTools.mustache index da854dcdd..7c477172e 100644 --- a/templates/PageTools.mustache +++ b/templates/PageTools.mustache @@ -4,7 +4,7 @@ object data-page-actions }}