Closed jdlrobson closed 7 months ago
(Full disclosure: final code untested as I couldn't work out how to get it running locally)
Thanks for updating README. Run out of time today, but can take a look tomorrow and give the readme a spin.
Amended and tested:
I had another idea of how we might approach this here - https://gerrit.wikimedia.org/r/c/mediawiki/skins/Vector/+/878212 I quite like this idea as it allows skins to reimplement the mediawiki.util
methods. If not implemented in the skin it would throw an exception so the more menu code would look something like
try {
var moreMenu = mw.util.addPortlet( 'p-more', [ { href:'#', text: 'link 1' } ] )
} catch (e) {
// existing code.
}
@MusikAnimal looks like this broke again: https://phabricator.wikimedia.org/T337893
I'm still out on vacation, but perhaps we could work together on the core code to find a more long term solution here.
Almost 2 years since this PR was opened! I think now that we're using mw.addPortlet
, the risk of future breakage is a bit lower. Changes to CSS classes on individual menu items is still prone to breakage, but I'm comfortable with updating MoreMenu as necessary when this happens, so I will close this PR.
I want to thank you @jdlrobson for going out of your way to create this PR, and for all of your efforts to mitigate conflicts with scripts/gadgets as Vector 2022 evolved.
Clone an existing menu to work out the menu structure. (Follow up to #25#issuecomment-1064558959 )
@MusikAnimal what do you think about this patch? While it won't prevent breakage, I think it will reduce the breakage. It will also throw an error when action needs to be taken, so when it does break we'll know right away (hopefully via an email alert).