| 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 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 this.document_, this.dataModel_, this.selectionModel_, thumbnailModel); | 334 this.document_, this.dataModel_, this.selectionModel_, thumbnailModel); |
| 335 this.ribbonSpacer_.appendChild(this.ribbon_); | 335 this.ribbonSpacer_.appendChild(this.ribbon_); |
| 336 | 336 |
| 337 util.createChild(this.container_, 'spinner'); | 337 util.createChild(this.container_, 'spinner'); |
| 338 | 338 |
| 339 /** | 339 /** |
| 340 * @type {!HTMLElement} | 340 * @type {!HTMLElement} |
| 341 * @const | 341 * @const |
| 342 */ | 342 */ |
| 343 var slideShowButton = queryRequiredElement(this.topToolbar_, | 343 var slideShowButton = queryRequiredElement(this.topToolbar_, |
| 344 '.button.slideshow'); | 344 'button.slideshow'); |
| 345 slideShowButton.title = this.displayStringFunction_('GALLERY_SLIDESHOW'); |
| 345 slideShowButton.addEventListener('click', | 346 slideShowButton.addEventListener('click', |
| 346 this.startSlideshow.bind(this, SlideMode.SLIDESHOW_INTERVAL_FIRST)); | 347 this.startSlideshow.bind(this, SlideMode.SLIDESHOW_INTERVAL_FIRST)); |
| 347 | 348 |
| 348 /** | 349 /** |
| 349 * @type {!HTMLElement} | 350 * @type {!HTMLElement} |
| 350 * @const | 351 * @const |
| 351 */ | 352 */ |
| 352 var slideShowToolbar = util.createChild( | 353 var slideShowToolbar = util.createChild( |
| 353 this.container_, 'tool slideshow-toolbar'); | 354 this.container_, 'tool slideshow-toolbar'); |
| 354 util.createChild(slideShowToolbar, 'slideshow-play'). | 355 util.createChild(slideShowToolbar, 'slideshow-play'). |
| 355 addEventListener('click', this.toggleSlideshowPause_.bind(this)); | 356 addEventListener('click', this.toggleSlideshowPause_.bind(this)); |
| 356 util.createChild(slideShowToolbar, 'slideshow-end'). | 357 util.createChild(slideShowToolbar, 'slideshow-end'). |
| 357 addEventListener('click', this.stopSlideshow_.bind(this)); | 358 addEventListener('click', this.stopSlideshow_.bind(this)); |
| 358 | 359 |
| 359 // Editor. | 360 // Editor. |
| 360 /** | 361 /** |
| 361 * @type {!HTMLElement} | 362 * @type {!HTMLElement} |
| 362 * @private | 363 * @private |
| 363 * @const | 364 * @const |
| 364 */ | 365 */ |
| 365 this.editButton_ = queryRequiredElement(this.topToolbar_, '.button.edit'); | 366 this.editButton_ = queryRequiredElement(this.topToolbar_, 'button.edit'); |
| 367 this.editButton_.title = this.displayStringFunction_('GALLERY_EDIT'); |
| 368 this.editButton_.disabled = true; // Disabled by default. |
| 366 this.editButton_.addEventListener('click', this.toggleEditor.bind(this)); | 369 this.editButton_.addEventListener('click', this.toggleEditor.bind(this)); |
| 367 | 370 |
| 368 /** | 371 /** |
| 369 * @type {!HTMLElement} | 372 * @type {!HTMLElement} |
| 370 * @private | 373 * @private |
| 371 * @const | 374 * @const |
| 372 */ | 375 */ |
| 373 this.printButton_ = queryRequiredElement(this.topToolbar_, '.button.print'); | 376 this.printButton_ = queryRequiredElement(this.topToolbar_, 'button.print'); |
| 377 this.printButton_.title = this.displayStringFunction_('GALLERY_PRINT'); |
| 378 this.printButton_.disabled = true; // Disabled by default. |
| 374 this.printButton_.addEventListener('click', this.print_.bind(this)); | 379 this.printButton_.addEventListener('click', this.print_.bind(this)); |
| 375 | 380 |
| 376 /** | 381 /** |
| 377 * @type {!HTMLElement} | 382 * @type {!HTMLElement} |
| 378 * @private | 383 * @private |
| 379 * @const | 384 * @const |
| 380 */ | 385 */ |
| 381 this.editBarSpacer_ = queryRequiredElement(this.bottomToolbar_, | 386 this.editBarSpacer_ = queryRequiredElement(this.bottomToolbar_, |
| 382 '.edit-bar-spacer'); | 387 '.edit-bar-spacer'); |
| 383 | 388 |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1865 var event = assertInstanceof(event, MouseEvent); | 1870 var event = assertInstanceof(event, MouseEvent); |
| 1866 var viewport = this.slideMode_.getViewport(); | 1871 var viewport = this.slideMode_.getViewport(); |
| 1867 if (!this.enabled_ || !viewport.isZoomed()) | 1872 if (!this.enabled_ || !viewport.isZoomed()) |
| 1868 return; | 1873 return; |
| 1869 this.stopOperation(); | 1874 this.stopOperation(); |
| 1870 viewport.setOffset( | 1875 viewport.setOffset( |
| 1871 viewport.getOffsetX() + event.wheelDeltaX, | 1876 viewport.getOffsetX() + event.wheelDeltaX, |
| 1872 viewport.getOffsetY() + event.wheelDeltaY); | 1877 viewport.getOffsetY() + event.wheelDeltaY); |
| 1873 this.slideMode_.applyViewportChange(); | 1878 this.slideMode_.applyViewportChange(); |
| 1874 }; | 1879 }; |
| OLD | NEW |