mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-15 10:59:56 +00:00
Use 'demote' only to move cite tools to insert group
Leave include as '*' as changing it to an array currently breaks the wildcard functionality. Also rewrite the hack slightly so it only modifies the list, rather than overwriting it. Bug: T139727 Change-Id: I041bad6346a4f39e967dca8cc610100463be0ded
This commit is contained in:
parent
85b34579cf
commit
5f4b86a9be
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue