Clarify result handling in JavaScript

Change-Id: Id79340512854cb2e86a9275239bc9be79db26728
This commit is contained in:
Fomafix 2018-05-24 10:33:36 +02:00
parent 616e9e5dfe
commit 3232eedeb3

View file

@ -163,6 +163,8 @@
uselang: mw.config.get( 'wgUserLanguage' ),
formatversion: 2
} ).done( function ( data ) {
var $data;
data = data.categorytree.html;
if ( data === '' ) {
@ -184,12 +186,13 @@
data = mw.msg( 'categorytree-nothing-found' );
}
data = $( '<i class="CategoryTreeNotice"></i>' ).text( data );
$data = $( '<i class="CategoryTreeNotice"></i>' ).text( data );
} else {
$data = $( $.parseHTML( data ) );
attachHandler( $data );
}
$children.html( data );
attachHandler( $children );
$children.empty().append( $data );
} )
.fail( error );
};