wikimedia-gadgets / twinkle

The English Wikipedia twinkle javascript helper
http://en.wikipedia.org/wiki/Wikipedia:Twinkle
Other
135 stars 151 forks source link

twinkle: fix vector-2022 "Twinkle and Page tools overlap when both open" #1749

Open NovemLinguae opened 1 year ago

NovemLinguae commented 1 year ago

Original bug: https://phabricator.wikimedia.org/T328792

Suggested solution by Jdlrobson (should investigate adding this code somewhere to Twinkle and see if it fixes the issue in vector-2022):


$(document).on('click', '#vector-page-tools-dropdown', function () {
    $( '#p-twinkle input[type="checkbox"]').prop('checked',false);
} );
$(document).on('mouseover', '#p-twinkle', function () {
    $( '#vector-page-tools-dropdown input[type="checkbox"]').prop('checked',false);
} );
jdlrobson commented 1 year ago

The main crux of the issue here is that menus intentiomally don't display on hover in Vector 2022.

Some people have gadgets that do that. With that in mind another alternative would be to only add the :hover CSS rule to vector 2010 and let editors use other gadgets when they want Twinkle to show on hover.

I should note if there was an API for adding menus, then this is the behaviour Twinkle would get by default, so perhaps with that in mind removing this hover behaviour would be a better idea.