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 /** | 7 /** |
8 * The current selection object. | 8 * The current selection object. |
9 * | 9 * |
10 * @param {FileManager} fileManager FileManager instance. | 10 * @param {FileManager} fileManager FileManager instance. |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 */ | 315 */ |
316 FileSelectionHandler.prototype.updatePreviewPanelVisibility_ = function() { | 316 FileSelectionHandler.prototype.updatePreviewPanelVisibility_ = function() { |
317 var panel = this.previewPanel_; | 317 var panel = this.previewPanel_; |
318 var state = panel.getAttribute('visibility'); | 318 var state = panel.getAttribute('visibility'); |
319 var mustBeVisible = (this.selection.totalCount > 0); | 319 var mustBeVisible = (this.selection.totalCount > 0); |
320 if (util.platform.newUI()) { | 320 if (util.platform.newUI()) { |
321 mustBeVisible = (this.selection.totalCount > 0 || | 321 mustBeVisible = (this.selection.totalCount > 0 || |
322 !PathUtil.isRootPath(this.fileManager_.getCurrentDirectory())); | 322 !PathUtil.isRootPath(this.fileManager_.getCurrentDirectory())); |
323 } | 323 } |
324 var self = this; | 324 var self = this; |
325 var fm = this.fileManager_; | |
326 | 325 |
327 var stopHidingAndShow = function() { | 326 var stopHidingAndShow = function() { |
328 clearTimeout(self.hidingTimeout_); | 327 clearTimeout(self.hidingTimeout_); |
329 self.hidingTimeout_ = 0; | 328 self.hidingTimeout_ = 0; |
330 setVisibility('visible'); | 329 setVisibility('visible'); |
331 }; | 330 }; |
332 | 331 |
333 var startHiding = function() { | 332 var startHiding = function() { |
334 setVisibility('hiding'); | 333 setVisibility('hiding'); |
335 self.hidingTimeout_ = setTimeout(function() { | 334 self.hidingTimeout_ = setTimeout(function() { |
336 self.hidingTimeout_ = 0; | 335 self.hidingTimeout_ = 0; |
337 setVisibility('hidden'); | 336 setVisibility('hidden'); |
338 fm.onResize_(); | |
339 }, 250); | 337 }, 250); |
340 }; | 338 }; |
341 | 339 |
342 var show = function() { | 340 var show = function() { |
343 setVisibility('visible'); | 341 setVisibility('visible'); |
344 self.previewThumbnails_.textContent = ''; | 342 self.previewThumbnails_.textContent = ''; |
345 fm.onResize_(); | |
346 }; | 343 }; |
347 | 344 |
348 var setVisibility = function(visibility) { | 345 var setVisibility = function(visibility) { |
349 panel.setAttribute('visibility', visibility); | 346 panel.setAttribute('visibility', visibility); |
350 }; | 347 }; |
351 | 348 |
352 switch (state) { | 349 switch (state) { |
353 case 'visible': | 350 case 'visible': |
354 if (!mustBeVisible) | 351 if (!mustBeVisible) |
355 startHiding(); | 352 startHiding(); |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 style.left = (boxWidth - imageWidth) / 2 + 'px'; | 749 style.left = (boxWidth - imageWidth) / 2 + 'px'; |
753 style.top = (boxHeight - imageHeight) / 2 + 'px'; | 750 style.top = (boxHeight - imageHeight) / 2 + 'px'; |
754 style.position = 'relative'; | 751 style.position = 'relative'; |
755 | 752 |
756 util.applyTransform(largeImage, transform); | 753 util.applyTransform(largeImage, transform); |
757 | 754 |
758 largeImageBox.appendChild(largeImage); | 755 largeImageBox.appendChild(largeImage); |
759 largeImageBox.style.zIndex = 1000; | 756 largeImageBox.style.zIndex = 1000; |
760 return true; | 757 return true; |
761 }; | 758 }; |
OLD | NEW |