Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Unified Diff: ui/file_manager/gallery/js/slide_mode.js

Issue 2229733002: Fix index changed when no image in the directory in gallery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix index changed when no image in the directory in gallery Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/file_manager/gallery/js/slide_mode.js
diff --git a/ui/file_manager/gallery/js/slide_mode.js b/ui/file_manager/gallery/js/slide_mode.js
index 54ccfc190836c795c1f1bde488583cff4d7f9a5f..a74919151ae9d279722119a83c691609b3491ec7 100644
--- a/ui/file_manager/gallery/js/slide_mode.js
+++ b/ui/file_manager/gallery/js/slide_mode.js
@@ -927,6 +927,9 @@ SlideMode.prototype.getNextSelectedIndex_ = function(direction) {
* @param {string} keyID Key of the KeyboardEvent.
*/
SlideMode.prototype.advanceWithKeyboard = function(keyID) {
+ if (this.getItemCount_() === 0)
+ return;
+
var prev = (keyID === 'ArrowUp' ||
keyID === 'ArrowLeft' ||
keyID === 'MediaTrackPrevious');
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698