| 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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 // Note that the SlideMode object is not listening to selection change yet. | 553 // Note that the SlideMode object is not listening to selection change yet. |
| 554 this.select(Math.max(0, this.getSelectedIndex())); | 554 this.select(Math.max(0, this.getSelectedIndex())); |
| 555 | 555 |
| 556 // Show the selected item ASAP, then complete the initialization | 556 // Show the selected item ASAP, then complete the initialization |
| 557 // (loading the ribbon thumbnails can take some time). | 557 // (loading the ribbon thumbnails can take some time). |
| 558 var selectedItem = this.getSelectedItem(); | 558 var selectedItem = this.getSelectedItem(); |
| 559 this.displayedItem_ = selectedItem; | 559 this.displayedItem_ = selectedItem; |
| 560 | 560 |
| 561 // Load the image of the item. | 561 // Load the image of the item. |
| 562 this.loadItem_( | 562 this.loadItem_( |
| 563 selectedItem, | 563 assert(selectedItem), |
| 564 zoomFromRect ? | 564 zoomFromRect ? |
| 565 this.imageView_.createZoomEffect(zoomFromRect) : | 565 this.imageView_.createZoomEffect(zoomFromRect) : |
| 566 new ImageView.Effect.None(), | 566 new ImageView.Effect.None(), |
| 567 displayCallback, | 567 displayCallback, |
| 568 function(loadType, delay) { | 568 function(loadType, delay) { |
| 569 fulfill(delay); | 569 fulfill(delay); |
| 570 }); | 570 }); |
| 571 }.bind(this)).then(function(delay) { | 571 }.bind(this)).then(function(delay) { |
| 572 // Turn the mode active. | 572 // Turn the mode active. |
| 573 this.active_ = true; | 573 this.active_ = true; |
| (...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 var event = assertInstanceof(event, MouseEvent); | 1865 var event = assertInstanceof(event, MouseEvent); |
| 1866 var viewport = this.slideMode_.getViewport(); | 1866 var viewport = this.slideMode_.getViewport(); |
| 1867 if (!this.enabled_ || !viewport.isZoomed()) | 1867 if (!this.enabled_ || !viewport.isZoomed()) |
| 1868 return; | 1868 return; |
| 1869 this.stopOperation(); | 1869 this.stopOperation(); |
| 1870 viewport.setOffset( | 1870 viewport.setOffset( |
| 1871 viewport.getOffsetX() + event.wheelDeltaX, | 1871 viewport.getOffsetX() + event.wheelDeltaX, |
| 1872 viewport.getOffsetY() + event.wheelDeltaY); | 1872 viewport.getOffsetY() + event.wheelDeltaY); |
| 1873 this.slideMode_.applyViewportChange(); | 1873 this.slideMode_.applyViewportChange(); |
| 1874 }; | 1874 }; |
| OLD | NEW |