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

Side by Side Diff: chrome/browser/resources/file_manager/js/photo/tile_view.js

Issue 12212187: [Cleanup] Files.app: Misc style fixes in Javascript code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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/photo/source.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 /** 5 /**
6 * Tile view displays images/videos tiles. 6 * Tile view displays images/videos tiles.
7 *
7 * @param {HTMLDocument} document Document. 8 * @param {HTMLDocument} document Document.
8 * @param {function(TailBox, callback)} prepareBox This function should provide 9 * @param {function(TailBox, callback)} prepareBox This function should provide
9 * the passed box with width and height properties of the image. 10 * the passed box with width and height properties of the image.
10 * @param {function(TailBox, callback)} loadBox This function should display 11 * @param {function(TailBox, callback)} loadBox This function should display
11 * the image in the box respecting clientWidth and clientHeight. 12 * the image in the box respecting clientWidth and clientHeight.
12 * @constructor 13 * @constructor
13 */ 14 */
14 function TileView(document, prepareBox, loadBox) { 15 function TileView(document, prepareBox, loadBox) {
15 var self = document.createElement('div'); 16 var self = document.createElement('div');
16 TileView.decorate(self, prepareBox, loadBox); 17 TileView.decorate(self, prepareBox, loadBox);
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
442 self.ready = false; 443 self.ready = false;
443 self.rect = {row: 0, col: 0, width: 0, height: 0}; 444 self.rect = {row: 0, col: 0, width: 0, height: 0};
444 445
445 self.index = null; 446 self.index = null;
446 self.height = null; 447 self.height = null;
447 self.width = null; 448 self.width = null;
448 }; 449 };
449 450
450 /** 451 /**
451 * Sets box position according to the |rect| property and given sizes. 452 * Sets box position according to the |rect| property and given sizes.
452 * @constructor
453 * @param {number} margin Margin between cells. 453 * @param {number} margin Margin between cells.
454 * @param {number} cellSize The size of one cell. 454 * @param {number} cellSize The size of one cell.
455 * @constructor
455 */ 456 */
456 TileBox.setPositionFromRect = function(margin, cellSize) { 457 TileBox.setPositionFromRect = function(margin, cellSize) {
457 this.style.top = margin + (cellSize + margin) * this.rect.row + 'px'; 458 this.style.top = margin + (cellSize + margin) * this.rect.row + 'px';
458 this.style.left = margin + (cellSize + margin) * this.rect.col + 'px'; 459 this.style.left = margin + (cellSize + margin) * this.rect.col + 'px';
459 this.style.height = (cellSize + margin) * this.rect.height - margin + 'px'; 460 this.style.height = (cellSize + margin) * this.rect.height - margin + 'px';
460 this.style.width = (cellSize + margin) * this.rect.width - margin + 'px'; 461 this.style.width = (cellSize + margin) * this.rect.width - margin + 'px';
461 }; 462 };
OLDNEW
« no previous file with comments | « chrome/browser/resources/file_manager/js/photo/source.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698