RTL: Add direction-aware arrow key utilities

We need these all over the place.
This commit is contained in:
Abe Jellinek 2024-07-08 15:52:02 -04:00 committed by Dan Stillman
parent b0fa4415ee
commit ea2d4417e1

View file

@ -75,6 +75,8 @@ Zotero.Intl = new function () {
// Set the locale direction to Zotero.dir
Zotero.dir = Zotero.Locale.defaultScriptDirection(Zotero.locale);
Zotero.rtl = (Zotero.dir === 'rtl');
Zotero.arrowPreviousKey = Zotero.rtl ? 'ArrowRight' : 'ArrowLeft';
Zotero.arrowNextKey = Zotero.rtl ? 'ArrowLeft' : 'ArrowRight';
this.strings = {};
const intlFiles = ['zotero.dtd', 'preferences.dtd', 'mozilla/editMenuOverlay.dtd'];