Merge "Removing code related to old page-action menu markup"

This commit is contained in:
jenkins-bot 2019-04-10 20:56:07 +00:00 committed by Gerrit Code Review
commit effda33eab
3 changed files with 10 additions and 85 deletions

View File

@ -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.

View File

@ -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 $( '<li>' ).append( icon.$el ).append( spinner.$el.hide() );
} else {
return $( '<li>' ).addClass( 'page-actions-menu__list-item' ).append( icon.$el ).append( spinner.$el.hide() );
}
return $( '<li>' ).addClass( 'page-actions-menu__list-item' ).append( icon.$el ).append( spinner.$el.hide() );
} else {
return null;
}

View File

@ -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'
} );