From 5f31ddeb8f6b63fac1786f818aadc7c4fbc182fe Mon Sep 17 00:00:00 2001 From: Ed Sanders Date: Thu, 8 Sep 2016 16:19:29 -0700 Subject: [PATCH] VE: Make all edits 'quick edit' on mobile Mobile doesn't really have room for the full dialog. Change-Id: I08f45c3b26bd88f75deb4dbd51435a109021f0fe --- modules/ve-math/ve.ui.MWMathContextItem.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/modules/ve-math/ve.ui.MWMathContextItem.js b/modules/ve-math/ve.ui.MWMathContextItem.js index a247672..a5f8d67 100644 --- a/modules/ve-math/ve.ui.MWMathContextItem.js +++ b/modules/ve-math/ve.ui.MWMathContextItem.js @@ -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 );