Commit d881ca38 authored by Kyle Milka's avatar Kyle Milka Committed by Commit Bot

[NTP] Fix RTL arrow key navigation

Previously arrow key navigation was fixed for the collection
selection dialog in RTL mode, but not for the image
selection dialog.

Bug: 880764
Change-Id: I96f4f007d6f8f8ecda7a5f72e8353e75a6391211
Reviewed-on: https://chromium-review.googlesource.com/1220767Reviewed-by: default avatarKristi Park <kristipark@chromium.org>
Commit-Queue: Kyle Milka <kmilka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590573}
parent 2ae52e1c
......@@ -716,11 +716,15 @@ customBackgrounds.showImageSelectionDialog = function(dialogTitle) {
let target = null;
if (event.keyCode == customBackgrounds.KEYCODES.LEFT) {
target = customBackgrounds.getNextTile(-1, 0, this.dataset.tile_num);
target = customBackgrounds.getNextTile(
document.documentElement.classList.contains('rtl') ? 1 : -1, 0,
this.dataset.tile_num);
} else if (event.keyCode == customBackgrounds.KEYCODES.UP) {
target = customBackgrounds.getNextTile(0, -1, this.dataset.tile_num);
} else if (event.keyCode == customBackgrounds.KEYCODES.RIGHT) {
target = customBackgrounds.getNextTile(1, 0, this.dataset.tile_num);
target = customBackgrounds.getNextTile(
document.documentElement.classList.contains('rtl') ? -1 : 1, 0,
this.dataset.tile_num);
} else if (event.keyCode == customBackgrounds.KEYCODES.DOWN) {
target = customBackgrounds.getNextTile(0, 1, this.dataset.tile_num);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment