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

Unified Diff: chrome/browser/resources/local_ntp/most_visited_single.js

Issue 1061163003: [New Tab Page] Reset default parameters for NTP title.html, adding param for multiline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adapting style to local file. Created 5 years, 8 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
Index: chrome/browser/resources/local_ntp/most_visited_single.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_single.js b/chrome/browser/resources/local_ntp/most_visited_single.js
index 2d719ff700fa81e6a528c5b66f6e2cb5e687ee47..8590dca1fa174462c9bcac6e96c8ec4492db88e3 100644
--- a/chrome/browser/resources/local_ntp/most_visited_single.js
+++ b/chrome/browser/resources/local_ntp/most_visited_single.js
@@ -47,18 +47,25 @@ var LOG_TYPE = {
/**
- * Whether to use icons instead of thumbnails.
+ * Total number of tiles to show at any time. If the host page doesn't send
+ * enough tiles, we fill them blank.
* @const {number}
*/
+var NUMBER_OF_TILES = 8;
+
+
+/**
+ * Whether to use icons instead of thumbnails.
+ * @type {boolean}
+ */
var USE_ICONS = false;
/**
- * Total number of tiles to show at any time. If the host page doesn't send
- * enough tiles, we fill them blank.
- * @const {number}
+ * Number of lines to display in titles.
+ * @type {number}
*/
-var NUMBER_OF_TILES = 8;
+var NUM_TITLE_LINES = 1;
/**
@@ -345,6 +352,9 @@ var renderTile = function(data) {
var title = tile.querySelector('.mv-title');
title.innerText = data.title;
title.style.direction = data.direction || 'ltr';
+ if (NUM_TITLE_LINES > 1) {
fserb 2015/04/07 17:25:13 How is this supposed to work? It doesn't matter th
huangs 2015/04/07 17:28:22 It's number of lines per title. Single line title
+ title.classList.add('multiline');
+ }
var hasIcon = USE_ICONS && data.largeIconUrl;
var hasThumb = !USE_ICONS && data.thumbnailUrl;
@@ -427,6 +437,12 @@ var init = function() {
// Apply class for icon NTP, if specified.
USE_ICONS = queryArgs['icons'] == '1';
+ if ('ntl' in queryArgs) {
+ var ntl = parseInt(queryArgs['ntl'], 10);
+ if (isFinite(ntl))
+ NUM_TITLE_LINES = ntl;
+ }
+
// Duplicating NTP_DESIGN.mainClass.
document.querySelector('#most-visited').classList.add(
USE_ICONS ? 'icon-ntp' : 'thumb-ntp');
« no previous file with comments | « chrome/browser/resources/local_ntp/most_visited_single.css ('k') | chrome/browser/resources/local_ntp/most_visited_title.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698