Chromium Code Reviews| Index: chrome/browser/resources/ntp4/bookmarks_page.js |
| =================================================================== |
| --- chrome/browser/resources/ntp4/bookmarks_page.js (revision 98657) |
| +++ chrome/browser/resources/ntp4/bookmarks_page.js (working copy) |
| @@ -89,8 +89,11 @@ |
| * animate. |
| */ |
| setBounds: function(size, x, y) { |
| - this.style.width = this.style.height = size + 'px'; |
| + this.style.width = size + 'px'; |
| + this.style.height = bookmarksHeightForWidth(size) + 'px'; |
| + |
| this.style.left = x + 'px'; |
| + this.style.right = x + 'px'; |
| this.style.top = y + 'px'; |
| }, |
| @@ -173,6 +176,16 @@ |
| TilePage.initGridValues(bookmarksPageGridValues); |
| /** |
| + * Calculates the height for a Most Visited tile for a given width. The size |
| + * is based on a desired size of 96x72 ratio. |
| + * @return {number} The height. |
| + */ |
| + function bookmarksHeightForWidth(width) { |
| + // The 2s are for borders, the 31 is for the title. |
| + return (width - 2) * 72 / 96 + 2 + 31; |
| + } |
| + |
| + /** |
| * Creates a new BookmarksPage object. |
| * @constructor |
| * @extends {TilePage} |
| @@ -275,6 +288,9 @@ |
| return false; |
| }, |
| + /** @inheritDoc */ |
| + bookmarksHeightForWidth: bookmarksHeightForWidth, |
|
Evan Stade
2011/08/29 23:06:46
huh? shouldn't this be heightForWidth?
csilv
2011/08/30 00:45:29
Done.
|
| + |
| /** |
| * Invoked before a batch import begins. We will ignore added/changed |
| * notifications while the operation is in progress. |