Merge "VE: Make all edits 'quick edit' on mobile"

This commit is contained in:
jenkins-bot 2016-09-12 06:51:23 +00:00 committed by Gerrit Code Review
commit adbe57e0f3
1 changed files with 13 additions and 1 deletions

View File

@ -23,7 +23,10 @@ ve.ui.MWMathContextItem = function VeUiMWMathContextItem() {
flags: [ 'progressive' ]
} );
this.actionButtons.addItems( [ this.quickEditButton ], 0 );
// Don't show quick edit button in mobile as the primary action will be quick edit
if ( !this.context.isMobile() ) {
this.actionButtons.addItems( [ this.quickEditButton ], 0 );
}
this.quickEditButton.connect( this, { click: 'onInlineEditButtonClick' } );
@ -58,6 +61,15 @@ ve.ui.MWMathContextItem.prototype.onInlineEditButtonClick = function () {
this.context.getSurface().executeCommand( 'mathInspector' );
};
/**
* @inheritdoc
*/
ve.ui.MWMathContextItem.prototype.getCommand = function () {
return this.context.getSurface().commandRegistry.lookup(
this.context.isMobile() ? 'mathInspector' : this.constructor.static.commandName
);
};
/* Registration */
ve.ui.contextItemFactory.register( ve.ui.MWMathContextItem );