Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(780)

Side by Side Diff: chrome/browser/resources/file_manager/js/file_selection.js

Issue 15675007: Suppressed resizing when the preview panel shows and hides. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/file_manager.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698