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_; | 325 var fm = this.fileManager_; |
yoshiki
2013/05/29 07:09:38
nit: You can remove this line.
| |
326 | 326 |
327 var stopHidingAndShow = function() { | 327 var stopHidingAndShow = function() { |
328 clearTimeout(self.hidingTimeout_); | 328 clearTimeout(self.hidingTimeout_); |
329 self.hidingTimeout_ = 0; | 329 self.hidingTimeout_ = 0; |
330 setVisibility('visible'); | 330 setVisibility('visible'); |
331 }; | 331 }; |
332 | 332 |
333 var startHiding = function() { | 333 var startHiding = function() { |
334 setVisibility('hiding'); | 334 setVisibility('hiding'); |
335 self.hidingTimeout_ = setTimeout(function() { | 335 self.hidingTimeout_ = setTimeout(function() { |
336 self.hidingTimeout_ = 0; | 336 self.hidingTimeout_ = 0; |
337 setVisibility('hidden'); | 337 setVisibility('hidden'); |
338 fm.onResize_(); | |
339 }, 250); | 338 }, 250); |
340 }; | 339 }; |
341 | 340 |
342 var show = function() { | 341 var show = function() { |
343 setVisibility('visible'); | 342 setVisibility('visible'); |
344 self.previewThumbnails_.textContent = ''; | 343 self.previewThumbnails_.textContent = ''; |
345 fm.onResize_(); | |
346 }; | 344 }; |
347 | 345 |
348 var setVisibility = function(visibility) { | 346 var setVisibility = function(visibility) { |
349 panel.setAttribute('visibility', visibility); | 347 panel.setAttribute('visibility', visibility); |
350 }; | 348 }; |
351 | 349 |
352 switch (state) { | 350 switch (state) { |
353 case 'visible': | 351 case 'visible': |
354 if (!mustBeVisible) | 352 if (!mustBeVisible) |
355 startHiding(); | 353 startHiding(); |
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
758 style.left = (boxWidth - imageWidth) / 2 + 'px'; | 756 style.left = (boxWidth - imageWidth) / 2 + 'px'; |
759 style.top = (boxHeight - imageHeight) / 2 + 'px'; | 757 style.top = (boxHeight - imageHeight) / 2 + 'px'; |
760 style.position = 'relative'; | 758 style.position = 'relative'; |
761 | 759 |
762 util.applyTransform(largeImage, transform); | 760 util.applyTransform(largeImage, transform); |
763 | 761 |
764 largeImageBox.appendChild(largeImage); | 762 largeImageBox.appendChild(largeImage); |
765 largeImageBox.style.zIndex = 1000; | 763 largeImageBox.style.zIndex = 1000; |
766 return true; | 764 return true; |
767 }; | 765 }; |
OLD | NEW |