| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Slide mode displays a single image and has a set of controls to navigate | 8 * Slide mode displays a single image and has a set of controls to navigate |
| 9 * between the images and to edit an image. | 9 * between the images and to edit an image. |
| 10 * | 10 * |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 /** | 75 /** |
| 76 * @return {string} Mode title. | 76 * @return {string} Mode title. |
| 77 */ | 77 */ |
| 78 SlideMode.prototype.getTitle = function() { return 'GALLERY_SLIDE'; }; | 78 SlideMode.prototype.getTitle = function() { return 'GALLERY_SLIDE'; }; |
| 79 | 79 |
| 80 /** | 80 /** |
| 81 * Initialize the listeners. | 81 * Initialize the listeners. |
| 82 * @private | 82 * @private |
| 83 */ | 83 */ |
| 84 SlideMode.prototype.initListeners_ = function() { | 84 SlideMode.prototype.initListeners_ = function() { |
| 85 window.addEventListener('resize', this.onResize_.bind(this), false); | 85 window.addEventListener('resize', this.onResize_.bind(this)); |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 /** | 88 /** |
| 89 * Initialize the UI. | 89 * Initialize the UI. |
| 90 * @private | 90 * @private |
| 91 */ | 91 */ |
| 92 SlideMode.prototype.initDom_ = function() { | 92 SlideMode.prototype.initDom_ = function() { |
| 93 // Container for displayed image. | 93 // Container for displayed image. |
| 94 this.imageContainer_ = util.createChild( | 94 this.imageContainer_ = util.createChild( |
| 95 this.document_.querySelector('.content'), 'image-container'); | 95 this.document_.querySelector('.content'), 'image-container'); |
| (...skipping 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 861 |
| 862 return true; | 862 return true; |
| 863 }; | 863 }; |
| 864 | 864 |
| 865 /** | 865 /** |
| 866 * Resize handler. | 866 * Resize handler. |
| 867 * @private | 867 * @private |
| 868 */ | 868 */ |
| 869 SlideMode.prototype.onResize_ = function() { | 869 SlideMode.prototype.onResize_ = function() { |
| 870 this.viewport_.sizeByFrameAndFit(this.container_); | 870 this.viewport_.sizeByFrameAndFit(this.container_); |
| 871 this.viewport_.repaint(); | 871 this.viewport_.update(); |
| 872 this.editor_.getBuffer().draw(); |
| 872 }; | 873 }; |
| 873 | 874 |
| 874 /** | 875 /** |
| 875 * Update thumbnails. | 876 * Update thumbnails. |
| 876 */ | 877 */ |
| 877 SlideMode.prototype.updateThumbnails = function() { | 878 SlideMode.prototype.updateThumbnails = function() { |
| 878 this.ribbon_.reset(); | 879 this.ribbon_.reset(); |
| 879 if (this.active_) | 880 if (this.active_) |
| 880 this.ribbon_.redraw(); | 881 this.ribbon_.redraw(); |
| 881 }; | 882 }; |
| (...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1262 done = true; | 1263 done = true; |
| 1263 } | 1264 } |
| 1264 }.bind(this); | 1265 }.bind(this); |
| 1265 }; | 1266 }; |
| 1266 | 1267 |
| 1267 /** | 1268 /** |
| 1268 * If the user touched the image and moved the finger more than SWIPE_THRESHOLD | 1269 * If the user touched the image and moved the finger more than SWIPE_THRESHOLD |
| 1269 * horizontally it's considered as a swipe gesture (change the current image). | 1270 * horizontally it's considered as a swipe gesture (change the current image). |
| 1270 */ | 1271 */ |
| 1271 SwipeOverlay.SWIPE_THRESHOLD = 100; | 1272 SwipeOverlay.SWIPE_THRESHOLD = 100; |
| OLD | NEW |