mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
Merge "Search for toolbar place in toolbarConfig as well as actionConfig"
This commit is contained in:
commit
775de7751a
|
@ -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;
|
||||
} );
|
||||
}
|
||||
} );
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue