Fix column-sorting shortcuts on Windows (#4068)

This commit is contained in:
Abe Jellinek 2024-04-30 02:10:03 -04:00 committed by GitHub
parent b9a93faabb
commit 472ee72093
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -1627,12 +1627,10 @@ var ZoteroPane = new function()
let sortSubmenuKeys = document.getElementById('sortSubmenuKeys');
for (let i = 0; i < 10; i++) {
let key = document.createElement('key');
key.id = 'key_sortCol' + i;
let key = sortSubmenuKeys.children[i];
key.setAttribute('modifiers', Zotero.isMac ? 'accel alt control' : 'accel alt');
key.setAttribute('key', (i + 1) % 10);
key.addEventListener('command', () => ZoteroPane.itemsView.toggleSort(i, true));
sortSubmenuKeys.append(key);
}
}
catch (e) {

View file

@ -191,7 +191,20 @@
<key id="key_findPrevious2" keycode="&findAgainCmd.key2;" modifiers="shift" command="cmd_findPrevious"/>
</keyset>
<keyset id="sortSubmenuKeys"/>
<keyset id="sortSubmenuKeys">
<!-- Attributes are set in initItemsTree(), but these don't work on Windows if they're
created in JS -->
<key id="key_sortCol0"/>
<key id="key_sortCol1"/>
<key id="key_sortCol2"/>
<key id="key_sortCol3"/>
<key id="key_sortCol4"/>
<key id="key_sortCol5"/>
<key id="key_sortCol6"/>
<key id="key_sortCol7"/>
<key id="key_sortCol8"/>
<key id="key_sortCol9"/>
</keyset>
<vbox id="titlebar">
<hbox class="titlebar-icon-container">