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

Unified Diff: chrome/browser/resources/ntp/most_visited.js

Issue 3292003: De-suck the NTP a bit more: (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: Fix unit test Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/ntp/most_visited.js
diff --git a/chrome/browser/resources/ntp/most_visited.js b/chrome/browser/resources/ntp/most_visited.js
index acb0200b73f6114697c032e9cafce501d55ca60b..ca01c1e67d27b3547d62ea9e37fe0398e0951c47 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;
+ }
}
},
« no previous file with comments | « chrome/browser/resources/ntp/apps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698