| 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 /** | 5 /** |
| 6 * Tile view displays images/videos tiles. | 6 * Tile view displays images/videos tiles. |
| 7 * @param {HTMLDocument} document Document. | 7 * @param {HTMLDocument} document Document. |
| 8 * @param {function(TailBox, callback)} prepareBox This function should provide | 8 * @param {function(TailBox, callback)} prepareBox This function should provide |
| 9 * the passed box with width and height properties of the image. | 9 * the passed box with width and height properties of the image. |
| 10 * @param {function(TailBox, callback)} loadBox This function should display | 10 * @param {function(TailBox, callback)} loadBox This function should display |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 self.ready = false; | 442 self.ready = false; |
| 443 self.rect = {row: 0, col: 0, width: 0, height: 0}; | 443 self.rect = {row: 0, col: 0, width: 0, height: 0}; |
| 444 | 444 |
| 445 self.index = null; | 445 self.index = null; |
| 446 self.height = null; | 446 self.height = null; |
| 447 self.width = null; | 447 self.width = null; |
| 448 }; | 448 }; |
| 449 | 449 |
| 450 /** | 450 /** |
| 451 * Sets box position according to the |rect| property and given sizes. | 451 * Sets box position according to the |rect| property and given sizes. |
| 452 * @constructor |
| 452 * @param {number} margin Margin between cells. | 453 * @param {number} margin Margin between cells. |
| 453 * @param {number} cellSize The size of one cell. | 454 * @param {number} cellSize The size of one cell. |
| 454 */ | 455 */ |
| 455 TileBox.setPositionFromRect = function(margin, cellSize) { | 456 TileBox.setPositionFromRect = function(margin, cellSize) { |
| 456 this.style.top = margin + (cellSize + margin) * this.rect.row + 'px'; | 457 this.style.top = margin + (cellSize + margin) * this.rect.row + 'px'; |
| 457 this.style.left = margin + (cellSize + margin) * this.rect.col + 'px'; | 458 this.style.left = margin + (cellSize + margin) * this.rect.col + 'px'; |
| 458 this.style.height = (cellSize + margin) * this.rect.height - margin + 'px'; | 459 this.style.height = (cellSize + margin) * this.rect.height - margin + 'px'; |
| 459 this.style.width = (cellSize + margin) * this.rect.width - margin + 'px'; | 460 this.style.width = (cellSize + margin) * this.rect.width - margin + 'px'; |
| 460 }; | 461 }; |
| OLD | NEW |