Skip to content

Commit e4d5f24

Browse files
committed
Fix settings menu interactivity
1 parent 27211fc commit e4d5f24

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/github-custom-global-navigation.user.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2145,9 +2145,14 @@
21452145
newLiElement.setAttribute('id', liElementId);
21462146

21472147
newLiElement.onclick = () => {
2148-
GMC.open();
2148+
const closeButton = document.querySelector(SELECTORS.sidebars.right.closeButton);
2149+
if (!closeButton) {
2150+
logError(`Selector '${SELECTORS.sidebars.right.closeButton}' not found`);
2151+
} else {
2152+
closeButton.click();
2153+
}
21492154

2150-
if (GMC.get('on_open') === 'close sidebar') HEADER.querySelector(SELECTORS.sidebars.right.closeButton)?.click();
2155+
GMC.open();
21512156
};
21522157

21532158
const textElement = newLiElement.querySelector('[data-component="ActionList.Item--DividerContainer"]');
@@ -5836,15 +5841,6 @@
58365841
],
58375842
default: 'do nothing',
58385843
},
5839-
on_open: {
5840-
label: 'On open',
5841-
type: 'select',
5842-
options: [
5843-
'do nothing',
5844-
'close sidebar',
5845-
],
5846-
default: 'close sidebar',
5847-
},
58485844
menu_item_title: {
58495845
label: 'Menu item title',
58505846
type: 'text',

0 commit comments

Comments
 (0)