-
Notifications
You must be signed in to change notification settings - Fork 143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"TW" menu should come up as soon as possible #336
Comments
+1, this would be awesome to solve. Maybe (IANAD!) we could use CSS to add a placeholder, before the async JavaScript adds the content/links? |
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. |
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 |
It looks good on testwiki. I had a go at improving the selectors, although they might be too slow now - @hartman what do you think? 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. I was about to make a PR but I see you've got some new styles. They look good to me! What I said above about "doesn't matter if the TW menu shows up or not (e.g. Special pages)" is false. I did have to remove the CSS via JavaScript so that the timing was correct, but also I realize now we want TW on contributions pages :) I tested the appearance in a few browsers/OS's and all looked good. |
I had totally forgotten about this ticket... Thx for working on it people. !!! |
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?
The text was updated successfully, but these errors were encountered: