Revert "mediawiki.page.ready: When infusing, infuse by id, not by element"
authorBartosz Dziewoński <matma.rex@gmail.com>
Thu, 6 Aug 2015 09:16:37 +0000 (09:16 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 12 Aug 2015 13:32:56 +0000 (13:32 +0000)
Infusing by element is better, since it avoids the
document.getElementById() lookup and behaves better in case
of duplicate ids (which is invalid HTML, but happens).

This reverts commit 803d89173fc3a56871767663907785cb3eaf7aa5.
Depends on I11fd1c7f2434f904b9ddc94b0903f8278e06f3a1 in OOjs UI.

Bug: T105828
Change-Id: I8c1f5015229db7b8a391f324cfd96be4ac158041

resources/src/mediawiki.page/mediawiki.page.ready.js

index 70029a1..8ec4cf0 100644 (file)
@@ -64,7 +64,7 @@
                if ( $nodes.length ) {
                        mw.loader.using( 'mediawiki.widgets' ).done( function () {
                                $nodes.each( function () {
-                                       OO.ui.infuse( this.id );
+                                       OO.ui.infuse( this );
                                } );
                        } );
                }