User "Krinkle" posted a comment on MediaWiki.r82471.

Full URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82471#c25735
Commit summary:

Improving jquery.makeCollapsible & small fixed mw.util
* Making makeCollapsible more DRY.
* Small optimalizations and fixes in mw.util

Comment:

The non-JavaScript cases shouldn't be a problem due to the 'client-nojs' and 
'client-js' classes we have available very early on.

The fadeOut via click(), I'm not seeing that. jQuery shouldn't be doing any 
animation since it's already hidden. However it may be doing some calculations 
to determine that. But since nothing visually get's done, I'm trying to 
understand the issue. Also, it only triggers the click event for 1 element 
(note <code>eq(0)</code>), so that can't realistically cause any slowdown.

Although it'll take a fairly major change, how about the following:

* We use CSS (selecting <code>.client-js</code> only) to do the initial hiding 
of <code>.mw-collapsible.mw-collapsed</code> elements. That'll allow CSS to 
hide/prevent display of things before the browser even encounters them in the 
DOM.
** This makes the added instantHide mode in this commit redundant.

and/or

* Get rid of the .click() trigger. I like to do this very much. The reason it 
is currently still there is because custom trigggers need to be fired in order 
for them to be in the correct state (otherwise they will still 'think' the 
table is in the expanded state).
** And instead of the click() trigger, we would trigger a custom event (i.e. 
"<code>mw-collapsible-trigger.expand</code>"). Then third parties would use 
that event to do anything fancy related to the collapsing/expanding, separate 
from the toggling of the main element.

Let me know what you think.

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

Reply via email to