diff --git a/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js index 64824c1455..e71ee90d3e 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js @@ -61,12 +61,9 @@ ve.init.mw.MobileArticleTarget.static.toolbarGroups = [ // Placeholder for reference tools (e.g. Cite and/or Citoid) { name: 'reference' - }, - // Done with editing toolbar - { - name: 'done', - include: [ 'done' ] } + // "Done" tool is added in setupToolbar as it not part of the + // standard config (i.e. shouldn't be inhertied by TargetWidget) ]; ve.init.mw.MobileArticleTarget.static.trackingName = 'mobile'; @@ -154,6 +151,17 @@ ve.init.mw.MobileArticleTarget.prototype.setupToolbar = function ( surface ) { // Parent method ve.init.mw.MobileArticleTarget.super.prototype.setupToolbar.call( this, surface ); + this.getToolbar().setup( + this.constructor.static.toolbarGroups.concat( [ + // Done with editing toolbar + { + name: 'done', + include: [ 'done' ] + } + ] ), + surface + ); + this.toolbar.$element.addClass( 've-init-mw-mobileArticleTarget-toolbar' ); // Append the context to the toolbar this.toolbar.$bar.append( surface.getContext().$element ); @@ -305,6 +313,7 @@ ve.ui.MWDoneTool = function VeUiMWDoneTool() { OO.inheritClass( ve.ui.MWDoneTool, ve.ui.Tool ); ve.ui.MWDoneTool.static.name = 'done'; ve.ui.MWDoneTool.static.group = 'navigation'; +ve.ui.MWDoneTool.static.group.autoAddToCatchall = false; ve.ui.MWDoneTool.static.icon = 'check'; ve.ui.MWDoneTool.static.title = OO.ui.deferMsg( 'visualeditor-donebutton-tooltip' );