diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 05:59:47 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-01 05:59:47 +0000 |
commit | 1a13224309d6d1d94a2cd1b1d492cd2f78f20e94 (patch) | |
tree | 8408ce72902d64bfc6281224d3dbe6e750daad7a /chrome/browser/resources/ntp/most_visited.js | |
parent | 0ff62860f0db277412f8c56b43cc65356af6d820 (diff) | |
download | chromium_src-1a13224309d6d1d94a2cd1b1d492cd2f78f20e94.zip chromium_src-1a13224309d6d1d94a2cd1b1d492cd2f78f20e94.tar.gz chromium_src-1a13224309d6d1d94a2cd1b1d492cd2f78f20e94.tar.bz2 |
De-suck the NTP a bit more:
* When there are no apps, don't show the apps section.
* Expand the MV section by default, like it was in M6.
* Fix bug where recently closed is incorrectly toggleable.
* Stop showing miniview items for MV section when there is no more room.
* Don't show filler MV items in miniview.
* MV section is 5px too high because we were only apply extra padding
to the first section, even if that section was disabled.
TEST=Visual inspection.
Review URL: http://codereview.chromium.org/3292003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58139 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/resources/ntp/most_visited.js')
-rw-r--r-- | chrome/browser/resources/ntp/most_visited.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/resources/ntp/most_visited.js b/chrome/browser/resources/ntp/most_visited.js index acb0200..ca01c1e 100644 --- a/chrome/browser/resources/ntp/most_visited.js +++ b/chrome/browser/resources/ntp/most_visited.js @@ -561,6 +561,10 @@ var MostVisited = (function() { this.miniview.textContent = ''; var data = this.data.slice(0, MAX_MINIVIEW_ITEMS); for (var i = 0, item; item = data[i]; i++) { + if (item.filler) { + continue; + } + var span = document.createElement('span'); var a = span.appendChild(document.createElement('a')); a.href = item.url; @@ -568,6 +572,11 @@ var MostVisited = (function() { a.style.backgroundImage = url('chrome://favicon/' + item.url); a.className = 'item'; this.miniview.appendChild(span); + + if ((a.offsetLeft + a.offsetWidth) > this.miniview.offsetWidth) { + this.miniview.removeChild(span); + return; + } } }, |