Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"TW" menu should come up as soon as possible #336
The fact that the "TW" dropdown menu emerges a little bit later in the page loading process than everything else means that I misclick and edit pages instead of reading them (as the "Edit source" button moves under my mouse pointer, which used to be pointing at "Read") with depressing frequency.
Is it possible to make the "TW" dropdown menu appear faster in the loading script, and then have the rest of the menu loaded up a little later?
Next week gadgets will be able to have peer modules.
With this, it should be possible to fix this problem. You can have a hidden companion gadget, that is automatically enabled when you enable a primary gadget. This companion gadget can be a very simple styles only gadget, reserving space for the menu like:
Then once the JS loads loads, add new CSS like:
or something like that.
referenced this issue
Jun 12, 2017
I gave this a go on testwiki and I think it worked! :)
@atlight Did you want to check it out? The new relevant files are MediaWiki:Gadget-Twinkle.css (main gadget) and MediaWiki:Gadget-Twinkle-pagestyles.css, loaded as a peer CSS-only gadget as hartman recommended.
I think going this route, it doesn't matter if the TW menu shows up or not (e.g. Special pages), because the main Twinkle.css is always loaded and will remove the CSS placeholder.
It looks like there's a conflict with MoreMenu however, where the CSS placeholder isn't properly removed. I think I can fix that, but also Twinkle is taking over the
The issue of incompatibility with other gadgets is a problem though. You could always put a margin-left on the search portlet for MoreMenu, but then when a third gadget comes along that wants to do this, what will it do? Maybe we should leave that issue for future consideration and not net it hold us up for now.
It also occurred to me to check how will this work for people using enwiki in a RTL interface language, but it seems like the Twinkle menu already gets put in the wrong place in that case! We ought to fix that separately.
I agree. For MoreMenu I was going to use a pseudo-element to avoid conflicts with Twinkle, but obviously eventually gadgets will run out of selectors that they can use, and also won't know which ones are already being used. Hacky as can be but it's a good short-term solution, especially given Twinkle's popularity.