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