mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-27 17:51:09 +00:00
Merge "When opening new topic tool using any link, always activate the link in page tabs too"
This commit is contained in:
commit
359b80ed70
|
@ -447,8 +447,12 @@ function init( $container, state ) {
|
|||
}
|
||||
|
||||
function setupController( commentId, $link, mode, hideErrors ) {
|
||||
var commentController;
|
||||
var commentController, $addSectionLink;
|
||||
if ( commentId === utils.NEW_TOPIC_COMMENT_ID ) {
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$addSectionLink = $( '#ca-addsection a' );
|
||||
// When opening new topic tool using any link, always activate the link in page tabs too
|
||||
$link = $link.add( $addSectionLink );
|
||||
commentController = new NewTopicController( $pageContainer, parser );
|
||||
} else {
|
||||
commentController = new CommentController( $pageContainer, parser.findCommentById( commentId ), parser );
|
||||
|
@ -515,13 +519,9 @@ function init( $container, state ) {
|
|||
}
|
||||
if ( storage.get( 'reply/' + utils.NEW_TOPIC_COMMENT_ID + '/saveable' ) ) {
|
||||
mode = storage.get( 'reply/' + utils.NEW_TOPIC_COMMENT_ID + '/mode' );
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$link = $( '#ca-addsection a' );
|
||||
setupController( utils.NEW_TOPIC_COMMENT_ID, $link, mode, true );
|
||||
setupController( utils.NEW_TOPIC_COMMENT_ID, $( [] ), mode, true );
|
||||
} else if ( mw.config.get( 'wgDiscussionToolsStartNewTopicTool' ) ) {
|
||||
// eslint-disable-next-line no-jquery/no-global-selector
|
||||
$link = $( '#ca-addsection a' );
|
||||
setupController( utils.NEW_TOPIC_COMMENT_ID, $link );
|
||||
setupController( utils.NEW_TOPIC_COMMENT_ID, $( [] ) );
|
||||
}
|
||||
|
||||
// For debugging (now unused in the code)
|
||||
|
|
Loading…
Reference in a new issue