diff --git a/resources/skins.minerva.base.styles/pageactions.less b/resources/skins.minerva.base.styles/pageactions.less index 2ae0cdb..cc9c8e6 100644 --- a/resources/skins.minerva.base.styles/pageactions.less +++ b/resources/skins.minerva.base.styles/pageactions.less @@ -80,68 +80,6 @@ display: list-item; } -// TODO: T213352 Delete this nested block after varnish cache has cleared and selectors -// no longer apply. -#page-actions:not( .page-actions-menu__list ) { - font-size: @pageActionFontSize; - float: none; - border: 0; - overflow: hidden; - width: 100%; - margin-top: -2px; - border-top: @pageActionBorder solid @colorGray14; - border-bottom: @pageActionBorder solid @colorGray12; - padding: 0.5em 0; - - li { - display: inline-block; - // Needed for non-JavaScript users - position: relative; - cursor: pointer; - // Override .hlist rule. - margin-right: 0; - margin-bottom: 0; - float: right; - - // edit, language and watchstar - a { - // Needed for non-JavaScript users - position: absolute; - display: block; - width: 100%; - height: 100%; - // needed for ContentOverlay pointer arrow - margin: 0 0 8px; - cursor: pointer; - } - - &:first-child { - margin-top: 0; - } - } - - .language-selector { - float: left; - margin-left: -@iconGutterWidth; - - &.disabled { - cursor: default; - opacity: 0.25; - } - } - - #ca-edit { - margin-right: -@iconGutterWidth; - } -} - -// FIXME: cached HTML. Can be removed when work on T212216 -// has been deployed and varnish cache cleared. -.heading-holder #page-actions:not( .page-actions-menu__list ):first-child { - position: absolute; - bottom: 0; -} - // Watchstar is hidden for anonymous no-js users // While we could link the icon to the login/signup form, this is not // a perfect experience and could be confusing. diff --git a/resources/skins.minerva.scripts/downloadPageAction.js b/resources/skins.minerva.scripts/downloadPageAction.js index dae5251..c577348 100644 --- a/resources/skins.minerva.scripts/downloadPageAction.js +++ b/resources/skins.minerva.scripts/downloadPageAction.js @@ -125,12 +125,8 @@ * @returns {jQuery.Object|null} */ function downloadPageAction( skin, supportedNamespaces, windowObj ) { - var icon, spinner = icons.spinner(), - // TODO: T213352 Temporary cache compatibility - to be deleted. - // Any conditionals using this boolean should be DELETED when the - // old page action menu is no longer being served to users. - // eslint-disable-next-line no-jquery/no-global-selector - oldPageActionsDOM = $( '#page-actions.hlist' ).length > 0; + var icon, spinner = icons.spinner(); + if ( isAvailable( windowObj, skin.page, navigator.userAgent, @@ -141,17 +137,15 @@ glyphPrefix: 'minerva', title: msg( 'minerva-download' ), name: GLYPH, - tagName: oldPageActionsDOM ? 'div' : 'button', + tagName: 'button', events: { // will be bound to `this` click: getOnClickHandler( skin, spinner ) } } ); - if ( oldPageActionsDOM ) { - return $( '
  • ' ).append( icon.$el ).append( spinner.$el.hide() ); - } else { - return $( '
  • ' ).addClass( 'page-actions-menu__list-item' ).append( icon.$el ).append( spinner.$el.hide() ); - } + + return $( '
  • ' ).addClass( 'page-actions-menu__list-item' ).append( icon.$el ).append( spinner.$el.hide() ); + } else { return null; } diff --git a/resources/skins.minerva.scripts/init.js b/resources/skins.minerva.scripts/init.js index 1d1b885..fd9ca0a 100644 --- a/resources/skins.minerva.scripts/init.js +++ b/resources/skins.minerva.scripts/init.js @@ -207,19 +207,12 @@ */ function appendDownloadButton() { var $downloadAction = downloadPageAction( skin, - config.get( 'wgMinervaDownloadNamespaces', [] ), window ), - // TODO: T213352 Temporary cache compatibility - to be deleted. - // Any conditionals using this boolean should be DELETED when the - // old page action menu is no longer being served to users. - // eslint-disable-next-line no-jquery/no-global-selector - oldPageActionsDOM = $( '#page-actions.hlist' ).length > 0; + config.get( 'wgMinervaDownloadNamespaces', [] ), window ); if ( $downloadAction ) { - if ( oldPageActionsDOM ) { - $downloadAction.insertAfter( '#ca-watch' ); - } else { - $downloadAction.insertAfter( '.page-actions-menu__list-item:first-child' ); - } + + $downloadAction.insertAfter( '.page-actions-menu__list-item:first-child' ); + track( 'minerva.downloadAsPDF', { action: 'buttonVisible' } );