From 23158de319cf624b897c638f8138ae5ca78b2c21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartosz=20Dziewo=C5=84ski?= Date: Sat, 30 Dec 2017 03:21:32 +0100 Subject: [PATCH] Fix context menu for mobile TargetWidgets Depends on Ica66325a8267d14f25fbc537b956573d1d3cc336 in VE core. Bug: T157084 Change-Id: I9d9839d7e96eb1ef254e11554acfb955750a2915 --- .../targets/ve.init.mw.MobileArticleTarget.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 9c5dec82ae..10a31ff9d0 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js @@ -115,6 +115,21 @@ ve.init.mw.MobileArticleTarget.prototype.getSaveButtonLabel = function () { return OO.ui.deferMsg( 'visualeditor-savedialog-label-save-short' ); }; +/** + * @inheritdoc + */ +ve.init.mw.MobileArticleTarget.prototype.createTargetWidget = function ( config ) { + // Parent method + var targetWidget = ve.init.mw.MobileArticleTarget.super.prototype.createTargetWidget.call( this, config ); + + targetWidget.once( 'setup', function () { + // Append the context to the toolbar + targetWidget.getToolbar().$bar.append( targetWidget.getSurface().getContext().$element ); + } ); + + return targetWidget; +}; + /** * @inheritdoc */