mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-17 21:21:35 +00:00
25eb55000f
I did this wrong in a6147ffac8
, the
'dt-init-done' class was never cleared. Put it on another element.
Bug: T241861
Change-Id: I136bd9c12bcc80cff01f5d26a8a53524f0c533c6
23 lines
562 B
JavaScript
23 lines
562 B
JavaScript
var controller = require( 'ext.discussionTools.controller' );
|
|
|
|
/**
|
|
* @class mw.dt
|
|
* @singleton
|
|
*/
|
|
mw.dt = {};
|
|
|
|
if ( new mw.Uri().query.dtdebug ) {
|
|
mw.loader.load( 'ext.discussionTools.debug' );
|
|
} else {
|
|
mw.hook( 'wikipage.content' ).add( function ( $container ) {
|
|
$container.find( '.mw-parser-output' ).each( function () {
|
|
var $node = $( this );
|
|
// Don't re-run if we already handled this element
|
|
// eslint-disable-next-line no-jquery/no-class-state
|
|
if ( !$node.hasClass( 'dt-init-done' ) ) {
|
|
controller.init( $node );
|
|
}
|
|
} );
|
|
} );
|
|
}
|