Merge "Search for toolbar place in toolbarConfig as well as actionConfig"

This commit is contained in:
jenkins-bot 2023-02-16 00:00:25 +00:00 committed by Gerrit Code Review
commit 775de7751a

View file

@ -1,10 +1,16 @@
mw.loader.using( 'ext.visualEditor.targetLoader' ).then( function () {
mw.libs.ve.targetLoader.addPlugin( function () {
var target = ve.init.mw.DesktopArticleTarget;
if ( target ) {
var index = target.static.actionGroups[ 1 ].include.indexOf( 'changeDirectionality' );
target.static.actionGroups[ 1 ].include.splice( index, 0, 'codeMirror' );
var groups = target.static.toolbarGroups.concat( target.static.actionGroups );
groups.some( function ( group ) {
if ( group.name === 'pageMenu' ) {
var index = group.include.indexOf( 'changeDirectionality' );
group.include.splice( index, 0, 'codeMirror' );
return true;
}
return false;
} );
}
} );
} );