Fix column-sorting shortcuts on Windows (#4068)
This commit is contained in:
parent
b9a93faabb
commit
472ee72093
2 changed files with 15 additions and 4 deletions
|
@ -1627,12 +1627,10 @@ var ZoteroPane = new function()
|
||||||
|
|
||||||
let sortSubmenuKeys = document.getElementById('sortSubmenuKeys');
|
let sortSubmenuKeys = document.getElementById('sortSubmenuKeys');
|
||||||
for (let i = 0; i < 10; i++) {
|
for (let i = 0; i < 10; i++) {
|
||||||
let key = document.createElement('key');
|
let key = sortSubmenuKeys.children[i];
|
||||||
key.id = 'key_sortCol' + i;
|
|
||||||
key.setAttribute('modifiers', Zotero.isMac ? 'accel alt control' : 'accel alt');
|
key.setAttribute('modifiers', Zotero.isMac ? 'accel alt control' : 'accel alt');
|
||||||
key.setAttribute('key', (i + 1) % 10);
|
key.setAttribute('key', (i + 1) % 10);
|
||||||
key.addEventListener('command', () => ZoteroPane.itemsView.toggleSort(i, true));
|
key.addEventListener('command', () => ZoteroPane.itemsView.toggleSort(i, true));
|
||||||
sortSubmenuKeys.append(key);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
|
|
@ -191,7 +191,20 @@
|
||||||
<key id="key_findPrevious2" keycode="&findAgainCmd.key2;" modifiers="shift" command="cmd_findPrevious"/>
|
<key id="key_findPrevious2" keycode="&findAgainCmd.key2;" modifiers="shift" command="cmd_findPrevious"/>
|
||||||
</keyset>
|
</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">
|
<vbox id="titlebar">
|
||||||
<hbox class="titlebar-icon-container">
|
<hbox class="titlebar-icon-container">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue