mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-24 00:13:36 +00:00
NewTopicController: Fix tag list construction
Bug: T279157 Change-Id: I2fa8042878d0f24385a8528ef0ba26bd4689a387
This commit is contained in:
parent
9822a60757
commit
b4f72b7516
|
@ -130,14 +130,19 @@ NewTopicController.prototype.getUnsupportedNodeSelectors = function () {
|
|||
NewTopicController.prototype.getApiQuery = function ( comment, pageName, checkboxes ) {
|
||||
var data = NewTopicController.super.prototype.getApiQuery.call( this, comment, pageName, checkboxes );
|
||||
|
||||
// Rebuild the tags array and remove the reply tag
|
||||
var tags = ( data.dttags || '' ).split( ',' );
|
||||
var replyTag = tags.indexOf( 'discussiontools-reply' );
|
||||
if ( replyTag !== -1 ) {
|
||||
tags.splice( replyTag, 1 );
|
||||
}
|
||||
// Add the newtopic tag
|
||||
tags.push( 'discussiontools-newtopic' );
|
||||
|
||||
data = $.extend( {}, data, {
|
||||
paction: 'addtopic',
|
||||
sectiontitle: this.sectionTitle.getValue(),
|
||||
dttags: [
|
||||
'discussiontools',
|
||||
'discussiontools-newtopic',
|
||||
'discussiontools-' + this.replyWidget.getMode()
|
||||
].join( ',' )
|
||||
dttags: tags.join( ',' )
|
||||
} );
|
||||
|
||||
return data;
|
||||
|
|
Loading…
Reference in a new issue