Commit af769568 authored by estade@chromium.org's avatar estade@chromium.org

ntp: add tooltips for all tile types

BUG=none
TEST=manual

Review URL: http://codereview.chromium.org/7837008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99848 0039d316-1c4b-4281-b951-d872f2087c98
parent a1b6504e
...@@ -202,6 +202,7 @@ cr.define('ntp4', function() { ...@@ -202,6 +202,7 @@ cr.define('ntp4', function() {
imgDiv.className = 'app-icon-div'; imgDiv.className = 'app-icon-div';
imgDiv.appendChild(appImgContainer); imgDiv.appendChild(appImgContainer);
imgDiv.addEventListener('click', this.onClick_.bind(this)); imgDiv.addEventListener('click', this.onClick_.bind(this));
imgDiv.title = this.appData_.name;
this.imgDiv_ = imgDiv; this.imgDiv_ = imgDiv;
appContents.appendChild(imgDiv); appContents.appendChild(imgDiv);
this.appImgContainer_.style.position = 'absolute'; this.appImgContainer_.style.position = 'absolute';
...@@ -214,11 +215,12 @@ cr.define('ntp4', function() { ...@@ -214,11 +215,12 @@ cr.define('ntp4', function() {
chrome.send('getAppIconDominantColor', [this.id]); chrome.send('getAppIconDominantColor', [this.id]);
} else { } else {
appImgContainer.addEventListener('click', this.onClick_.bind(this)); appImgContainer.addEventListener('click', this.onClick_.bind(this));
appImgContainer.title = this.appData_.name;
appContents.appendChild(appImgContainer); appContents.appendChild(appImgContainer);
} }
var appSpan = this.ownerDocument.createElement('span'); var appSpan = this.ownerDocument.createElement('span');
appSpan.textContent = this.appData_.name; appSpan.textContent = appSpan.title = this.appData_.name;
appSpan.addEventListener('click', this.onClick_.bind(this)); appSpan.addEventListener('click', this.onClick_.bind(this));
appContents.appendChild(appSpan); appContents.appendChild(appSpan);
this.appendChild(appContents); this.appendChild(appContents);
......
...@@ -68,6 +68,9 @@ cr.define('ntp4', function() { ...@@ -68,6 +68,9 @@ cr.define('ntp4', function() {
var title = this.querySelector('.title'); var title = this.querySelector('.title');
title.textContent = this.data.title; title.textContent = this.data.title;
// Sets the tooltip.
this.title = this.data.title;
if (this.data.url) { if (this.data.url) {
var button = this.querySelector('.button'); var button = this.querySelector('.button');
button.href = title.href = this.data.url; button.href = title.href = this.data.url;
......
...@@ -64,6 +64,7 @@ cr.define('ntp4', function() { ...@@ -64,6 +64,7 @@ cr.define('ntp4', function() {
this.removeAttribute('tabIndex'); this.removeAttribute('tabIndex');
this.data_ = null; this.data_ = null;
this.removeAttribute('id'); this.removeAttribute('id');
this.title = '';
}, },
/** /**
...@@ -103,6 +104,9 @@ cr.define('ntp4', function() { ...@@ -103,6 +104,9 @@ cr.define('ntp4', function() {
title.textContent = data.title; title.textContent = data.title;
title.dir = data.direction; title.dir = data.direction;
// Sets the tooltip.
this.title = data.title;
var thumbnailUrl = data.thumbnailUrl || 'chrome://thumb/' + data.url; var thumbnailUrl = data.thumbnailUrl || 'chrome://thumb/' + data.url;
this.querySelector('.thumbnail').style.backgroundImage = this.querySelector('.thumbnail').style.backgroundImage =
url(thumbnailUrl); url(thumbnailUrl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment