Merge "Use 'demote' only to move cite tools to insert group"

This commit is contained in:
jenkins-bot 2016-07-12 20:51:59 +00:00 committed by Gerrit Code Review
commit 11295fe6a9

View file

@ -1,5 +1,5 @@
( function () {
var i, j, jLen, toolGroups, linkIndex, target, label, group;
var i, j, jLen, toolGroup, toolGroups, linkIndex, target, label, group;
// HACK: Find the position of the current citation toolbar definition
// and manipulate it.
@ -15,10 +15,10 @@
if ( mw.config.get( 'wgCiteVisualEditorOtherGroup' ) ) {
for ( j = 0; j < linkIndex; j++ ) {
if ( toolGroups[ j ].include === '*' ) {
toolGroups[ j ].type = 'list';
toolGroups[ j ].include = [ '*', { group: 'cite' }, 'reference', 'reference/existing' ];
toolGroups[ j ].demote = [ 'reference', 'reference/existing' ];
toolGroup = toolGroups[ j ];
if ( toolGroup.include === '*' && ( !toolGroup.demote || toolGroup.demote.indexOf( 'reference' ) === -1 ) ) {
toolGroup.demote = toolGroup.demote || [];
toolGroup.demote.push( { group: 'cite' }, 'reference', 'reference/existing' );
}
}
continue;