VE: Make all edits 'quick edit' on mobile

Mobile doesn't really have room for the full dialog.

Change-Id: I08f45c3b26bd88f75deb4dbd51435a109021f0fe
This commit is contained in:
Ed Sanders 2016-09-08 16:19:29 -07:00
parent d702595bd5
commit 5f31ddeb8f
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 );