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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * Slide mode displays a single image and has a set of controls to navigate 6 * Slide mode displays a single image and has a set of controls to navigate
7 * between the images and to edit an image. 7 * between the images and to edit an image.
8 * 8 *
9 * @param {!HTMLElement} container Main container element. 9 * @param {!HTMLElement} container Main container element.
10 * @param {!HTMLElement} content Content container element. 10 * @param {!HTMLElement} content Content container element.
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 } else { 920 } else {
921 return advance(this.getSelectedIndex(), this.getItemCount_()); 921 return advance(this.getSelectedIndex(), this.getItemCount_());
922 } 922 }
923 }; 923 };
924 924
925 /** 925 /**
926 * Advance the selection based on the pressed key ID. 926 * Advance the selection based on the pressed key ID.
927 * @param {string} keyID Key of the KeyboardEvent. 927 * @param {string} keyID Key of the KeyboardEvent.
928 */ 928 */
929 SlideMode.prototype.advanceWithKeyboard = function(keyID) { 929 SlideMode.prototype.advanceWithKeyboard = function(keyID) {
930 if (this.getItemCount_() === 0)
931 return;
932
930 var prev = (keyID === 'ArrowUp' || 933 var prev = (keyID === 'ArrowUp' ||
931 keyID === 'ArrowLeft' || 934 keyID === 'ArrowLeft' ||
932 keyID === 'MediaTrackPrevious'); 935 keyID === 'MediaTrackPrevious');
933 this.advanceManually(prev ? -1 : 1); 936 this.advanceManually(prev ? -1 : 1);
934 }; 937 };
935 938
936 /** 939 /**
937 * Advance the selection as a result of a user action (as opposed to an 940 * Advance the selection as a result of a user action (as opposed to an
938 * automatic change in the slideshow mode). 941 * automatic change in the slideshow mode).
939 * @param {number} direction -1 for left, 1 for right. 942 * @param {number} direction -1 for left, 1 for right.
(...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 /** 2136 /**
2134 * Handles mouse up events. 2137 * Handles mouse up events.
2135 * @param {!Event} event Wheel event. 2138 * @param {!Event} event Wheel event.
2136 * @private 2139 * @private
2137 */ 2140 */
2138 TouchHandler.prototype.onMouseUp_ = function(event) { 2141 TouchHandler.prototype.onMouseUp_ = function(event) {
2139 if (event.button !== 0) 2142 if (event.button !== 0)
2140 return; 2143 return;
2141 this.clickStarted_ = false; 2144 this.clickStarted_ = false;
2142 }; 2145 };
OLDNEW
« 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