mediawiki.action.edit.preview: Combine two the consecutive .push
authorFomafix <fomafix@googlemail.com>
Thu, 31 Dec 2015 21:52:05 +0000 (21:52 +0000)
committer[[mw:User:Fomafix]] <gerritpatchuploader@gmail.com>
Thu, 31 Dec 2015 21:52:05 +0000 (21:52 +0000)
Also add a comment to explain the whitespace.

Change-Id: Ia4a20074f5e8a5c897b121111aea4aa5bebab3ad

resources/src/mediawiki.action/mediawiki.action.edit.preview.js

index 9a639ba..013d34f 100644 (file)
                                                        .addClass( 'mw-indicator' )
                                                        .attr( 'id', mw.util.escapeId( 'mw-indicator-' + indicator.name ) )
                                                        .html( indicator[ '*' ] )
-                                                       .get( 0 )
+                                                       .get( 0 ),
+                                               // Add a whitespace between the <div>s because
+                                               // they get displayed with display: inline-block
+                                               document.createTextNode( '\n' )
                                        );
-                                       newList.push( document.createTextNode( '\n' ) );
                                } );
                                $( '.mw-indicators' ).empty().append( newList );