| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 util.addPageLoadHandler(function() { | 7 util.addPageLoadHandler(function() { |
| 8 if (!location.hash) | 8 if (!location.hash) |
| 9 return; | 9 return; |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 * @private | 242 * @private |
| 243 */ | 243 */ |
| 244 Gallery.prototype.initDom_ = function() { | 244 Gallery.prototype.initDom_ = function() { |
| 245 var content = util.createChild(this.container_, 'content'); | 245 var content = util.createChild(this.container_, 'content'); |
| 246 content.addEventListener('click', this.onContentClick_.bind(this)); | 246 content.addEventListener('click', this.onContentClick_.bind(this)); |
| 247 | 247 |
| 248 var closeButton = util.createChild(this.container_, 'close tool dimmable'); | 248 var closeButton = util.createChild(this.container_, 'close tool dimmable'); |
| 249 util.createChild(closeButton); | 249 util.createChild(closeButton); |
| 250 closeButton.addEventListener('click', this.onClose_.bind(this)); | 250 closeButton.addEventListener('click', this.onClose_.bind(this)); |
| 251 | 251 |
| 252 this.header_ = util.createChild(this.container_, 'header tool dimmable'); |
| 252 this.toolbar_ = util.createChild(this.container_, 'toolbar tool dimmable'); | 253 this.toolbar_ = util.createChild(this.container_, 'toolbar tool dimmable'); |
| 253 | 254 |
| 254 this.filenameSpacer_ = util.createChild(this.toolbar_, 'filename-spacer'); | 255 this.filenameSpacer_ = util.createChild(this.toolbar_, 'filename-spacer'); |
| 255 | 256 |
| 256 this.filenameEdit_ = util.createChild(this.filenameSpacer_, | 257 this.filenameEdit_ = util.createChild(this.filenameSpacer_, |
| 257 'namebox', 'input'); | 258 'namebox', 'input'); |
| 258 | 259 |
| 259 this.filenameEdit_.setAttribute('type', 'text'); | 260 this.filenameEdit_.setAttribute('type', 'text'); |
| 260 this.filenameEdit_.addEventListener('blur', | 261 this.filenameEdit_.addEventListener('blur', |
| 261 this.onFilenameEditBlur_.bind(this)); | 262 this.onFilenameEditBlur_.bind(this)); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 this.shareMenu_ = util.createChild(this.container_, 'share-menu'); | 304 this.shareMenu_ = util.createChild(this.container_, 'share-menu'); |
| 304 this.shareMenu_.hidden = true; | 305 this.shareMenu_.hidden = true; |
| 305 util.createChild(this.shareMenu_, 'bubble-point'); | 306 util.createChild(this.shareMenu_, 'bubble-point'); |
| 306 | 307 |
| 307 this.dataModel_.addEventListener('splice', this.onSplice_.bind(this)); | 308 this.dataModel_.addEventListener('splice', this.onSplice_.bind(this)); |
| 308 this.dataModel_.addEventListener('content', this.onContentChange_.bind(this)); | 309 this.dataModel_.addEventListener('content', this.onContentChange_.bind(this)); |
| 309 | 310 |
| 310 this.selectionModel_.addEventListener('change', this.onSelection_.bind(this)); | 311 this.selectionModel_.addEventListener('change', this.onSelection_.bind(this)); |
| 311 | 312 |
| 312 this.slideMode_.addEventListener('useraction', this.onUserAction_.bind(this)); | 313 this.slideMode_.addEventListener('useraction', this.onUserAction_.bind(this)); |
| 314 |
| 315 if (util.platform.newUI()) |
| 316 document.body.setAttribute('new-ui', ''); |
| 313 }; | 317 }; |
| 314 | 318 |
| 315 /** | 319 /** |
| 316 * Creates toolbar button. | 320 * Creates toolbar button. |
| 317 * | 321 * |
| 318 * @param {string} clazz Class to add. | 322 * @param {string} clazz Class to add. |
| 319 * @param {string} title Button title. | 323 * @param {string} title Button title. |
| 320 * @return {HTMLElement} Newly created button. | 324 * @return {HTMLElement} Newly created button. |
| 321 * @private | 325 * @private |
| 322 */ | 326 */ |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 889 Gallery.prototype.updateThumbnails_ = function() { | 893 Gallery.prototype.updateThumbnails_ = function() { |
| 890 if (this.currentMode_ == this.slideMode_) | 894 if (this.currentMode_ == this.slideMode_) |
| 891 this.slideMode_.updateThumbnails(); | 895 this.slideMode_.updateThumbnails(); |
| 892 | 896 |
| 893 if (this.mosaicMode_) { | 897 if (this.mosaicMode_) { |
| 894 var mosaic = this.mosaicMode_.getMosaic(); | 898 var mosaic = this.mosaicMode_.getMosaic(); |
| 895 if (mosaic.isInitialized()) | 899 if (mosaic.isInitialized()) |
| 896 mosaic.reload(); | 900 mosaic.reload(); |
| 897 } | 901 } |
| 898 }; | 902 }; |
| OLD | NEW |