Krinkle has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/74078


Change subject: Revert "mediawiki.page.startup: Explicitly use $( document 
).ready instead of $ for grepping"
......................................................................

Revert "mediawiki.page.startup: Explicitly use $( document ).ready instead of $ 
for grepping"

Greppability is no argument in this matter. Using
`$( document ).ready` is inferior to `$()` for many reasons:

* Redundant instantation of a jQuery object
  The .ready method doesn't really relate to the document you
  give it ($.fn.ready doesn't refer to `this` ever).
  It always add the function in the same callbacks list.
  Might as well call jQuery.fn.ready directly.
* Confusing as it doesn't use the document object you pass it.
* Redundant global variable lookup for `document`.

Though jQuery is to blame for this, we have a choice to use $()
instead which adds it to the domReady callbacks list with the
least overhead.

See also Ie370fec8c851607f5 which removes the remainder usage.

Change-Id: I9ed231ef759372ba122890facbbb21219e796b59
---
M resources/mediawiki.page/mediawiki.page.startup.js
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/74078/1

diff --git a/resources/mediawiki.page/mediawiki.page.startup.js 
b/resources/mediawiki.page/mediawiki.page.startup.js
index 029039d..ee61b72 100644
--- a/resources/mediawiki.page/mediawiki.page.startup.js
+++ b/resources/mediawiki.page/mediawiki.page.startup.js
@@ -13,6 +13,6 @@
        // Enqueued into domready from here instead of mediawiki.page.ready to 
ensure that it gets enqueued
        // before other modules hook into document ready, so that 
mw.util.$content (defined by mw.util.init),
        // is defined for them.
-       $( document ).ready( mw.util.init );
+       $( mw.util.init );
 
 }( mediaWiki, jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/74078
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ed231ef759372ba122890facbbb21219e796b59
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to