Skip to content

Commit

Permalink
twinkle: fix vector-2022 TW menu bug
Browse files Browse the repository at this point in the history
Fixes wikimedia-gadgets#1895 TW menu becomes unusable in vector-2022 if you dock the tools menu to the right side
  • Loading branch information
NovemLinguae committed Nov 23, 2023
1 parent 6e30957 commit 31d08c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twinkle.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ Twinkle.addPortlet = function(navigation, id, text, type, nextnodeid) {

var portlet = mw.util.addPortlet(id, text, '#' + nextnodeid);

// The Twinkle dropdown menu has been added to the left of p-cactions. Move it to the right.
// The Twinkle dropdown menu has been added to the left of p-cactions, since that is the only spot that will create a dropdown menu. But we want it on the right. Move it to the right.
if (mw.config.get('skin') === 'vector') {
$('#p-twinkle').insertAfter('#p-cactions');
} else if (mw.config.get('skin') === 'vector-2022') {
$('#p-twinkle-dropdown').appendTo('.vector-page-tools-landmark');
$('#p-twinkle-dropdown').insertAfter('#right-navigation > .vector-page-tools-landmark');

// .vector-page-tools-landmark is unstable and could change. If so, log it to console, to hopefully get someone's attention.
if (!document.querySelector('.vector-page-tools-landmark')) {
Expand Down

0 comments on commit 31d08c1

Please sign in to comment.