| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 }; |
| OLD | NEW |