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

Unified Diff: chrome/browser/resources/new_new_tab.js

Issue 149166: Add support for extended tooltips.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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/new_new_tab.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/new_new_tab.js
===================================================================
--- chrome/browser/resources/new_new_tab.js (revision 19884)
+++ chrome/browser/resources/new_new_tab.js (working copy)
@@ -191,7 +191,7 @@
t.querySelector('.thumbnail-wrapper').style.backgroundImage =
'url("chrome://thumb/' + d.url + '")';
var titleDiv = t.querySelector('.title > div');
- titleDiv.title = titleDiv.textContent = d.title;
+ titleDiv.xtitle = titleDiv.textContent = d.title;
titleDiv.style.backgroundImage = 'url("chrome://favicon/' + d.url + '")';
titleDiv.dir = d.direction;
}
@@ -1052,6 +1052,20 @@
}
}, true);
+// Tooltip for elements that have text that overflows.
+document.addEventListener('mouseover', function(e) {
+ var el = findAncestor(e.target, function(el) {
+ return el.xtitle;
+ });
+ if (el && el.xtitle != el.title) {
+ if (el.scrollWidth > el.clientWidth) {
+ el.title = el.xtitle;
+ } else {
+ el.title = '';
+ }
+ }
+});
+
// DnD
var dnd = {
« no previous file with comments | « chrome/browser/resources/new_new_tab.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698