mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Make the RTL shortcuts for recent and favorite presets the same as LTR (close #6107)
This commit is contained in:
@@ -109,20 +109,12 @@ export function uiToolAddFavorite(context) {
|
||||
protoMode.description = t(tooltipTitleID, { feature: '<strong>' + presetName + '</strong>' });
|
||||
|
||||
var keyCode;
|
||||
if (textDirection === 'ltr') {
|
||||
// use number row order: 1 2 3 4 5 6 7 8 9 0
|
||||
if (index === 9) {
|
||||
keyCode = 0;
|
||||
} else if (index < 10) {
|
||||
keyCode = index + 1;
|
||||
}
|
||||
} else {
|
||||
// use number row order from right to left
|
||||
if (index === 0) {
|
||||
keyCode = 0;
|
||||
} else if (index < 10) {
|
||||
keyCode = 10 - index;
|
||||
}
|
||||
// use number row order: 1 2 3 4 5 6 7 8 9 0
|
||||
// use the same for RTL even though the layout is backward: #6107
|
||||
if (index === 9) {
|
||||
keyCode = 0;
|
||||
} else if (index < 10) {
|
||||
keyCode = index + 1;
|
||||
}
|
||||
if (keyCode !== undefined) {
|
||||
protoMode.key = keyCode.toString();
|
||||
|
||||
@@ -146,20 +146,12 @@ export function uiToolAddRecent(context) {
|
||||
|
||||
var totalIndex = favoritesCount + index;
|
||||
var keyCode;
|
||||
if (textDirection === 'ltr') {
|
||||
// use number row order: 1 2 3 4 5 6 7 8 9 0
|
||||
if (totalIndex === 9) {
|
||||
keyCode = 0;
|
||||
} else if (totalIndex < 10) {
|
||||
keyCode = totalIndex + 1;
|
||||
}
|
||||
} else {
|
||||
// use number row order from right to left
|
||||
if (totalIndex === 0) {
|
||||
keyCode = 0;
|
||||
} else if (totalIndex < 10) {
|
||||
keyCode = 10 - totalIndex;
|
||||
}
|
||||
// use number row order: 1 2 3 4 5 6 7 8 9 0
|
||||
// use the same for RTL even though the layout is backward: #6107
|
||||
if (totalIndex === 9) {
|
||||
keyCode = 0;
|
||||
} else if (totalIndex < 10) {
|
||||
keyCode = totalIndex + 1;
|
||||
}
|
||||
if (keyCode !== undefined) {
|
||||
protoMode.key = keyCode.toString();
|
||||
|
||||
Reference in New Issue
Block a user