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

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: 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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 } 911 }
912 912
913 // If the saved selection is multiple the Slideshow should cycle through 913 // If the saved selection is multiple the Slideshow should cycle through
914 // the saved selection. 914 // the saved selection.
915 if (this.isSlideshowOn_() && 915 if (this.isSlideshowOn_() &&
916 this.savedSelection_ && this.savedSelection_.length > 1) { 916 this.savedSelection_ && this.savedSelection_.length > 1) {
917 var pos = advance(this.savedSelection_.indexOf(this.getSelectedIndex()), 917 var pos = advance(this.savedSelection_.indexOf(this.getSelectedIndex()),
918 this.savedSelection_.length); 918 this.savedSelection_.length);
919 return this.savedSelection_[pos]; 919 return this.savedSelection_[pos];
920 } else { 920 } else {
921 if(this.getSelectedIndex() == -1)
922 return -1;
harukam1 2016/08/09 07:18:57 "slideshowButton" icon shows because selectedIndex
fukino 2016/08/09 07:49:18 It's weird that selectionModel_.selectedIndexes.le
harukam1 2016/08/10 04:34:47 We have decided to modify advanceWithKeyboard meth
921 return advance(this.getSelectedIndex(), this.getItemCount_()); 923 return advance(this.getSelectedIndex(), this.getItemCount_());
922 } 924 }
923 }; 925 };
924 926
925 /** 927 /**
926 * Advance the selection based on the pressed key ID. 928 * Advance the selection based on the pressed key ID.
927 * @param {string} keyID Key of the KeyboardEvent. 929 * @param {string} keyID Key of the KeyboardEvent.
928 */ 930 */
929 SlideMode.prototype.advanceWithKeyboard = function(keyID) { 931 SlideMode.prototype.advanceWithKeyboard = function(keyID) {
930 var prev = (keyID === 'ArrowUp' || 932 var prev = (keyID === 'ArrowUp' ||
(...skipping 1202 matching lines...) Expand 10 before | Expand all | Expand 10 after
2133 /** 2135 /**
2134 * Handles mouse up events. 2136 * Handles mouse up events.
2135 * @param {!Event} event Wheel event. 2137 * @param {!Event} event Wheel event.
2136 * @private 2138 * @private
2137 */ 2139 */
2138 TouchHandler.prototype.onMouseUp_ = function(event) { 2140 TouchHandler.prototype.onMouseUp_ = function(event) {
2139 if (event.button !== 0) 2141 if (event.button !== 0)
2140 return; 2142 return;
2141 this.clickStarted_ = false; 2143 this.clickStarted_ = false;
2142 }; 2144 };
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