Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/filters-filteractions.js

Issue 29334565: Issue 1950 - Fixed: Filter tooltip not shown for long filters (Closed)
Patch Set: Created Jan. 26, 2016, 4:11 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.js » ('j') | chrome/content/ui/sidebar.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/filters-filteractions.js
===================================================================
--- a/chrome/content/ui/filters-filteractions.js
+++ b/chrome/content/ui/filters-filteractions.js
@@ -339,10 +339,17 @@
while (box.firstChild)
box.removeChild(box.firstChild);
- for (var i = 0; i < text.length; i += 80)
+ let lines = text.match(/.{1,80}/g);
+ if (lines.length > 6)
Erik 2016/01/29 04:29:31 I think this should be `if (lines.length > 7)` si
Thomas Greiner 2016/01/29 18:28:55 Done. I agree that the maximum of 482 characters t
{
- var description = document.createElement("description");
- description.setAttribute("value", text.substr(i, 80));
+ // Text is too long to display in full so we cut out the middle part
+ lines = lines.slice(0,3).concat("\u2026", lines.slice(-3));
+ }
+
+ for (let line of lines)
+ {
+ let description = document.createElement("description");
+ description.setAttribute("value", line);
box.appendChild(description);
}
}
« no previous file with comments | « no previous file | chrome/content/ui/sidebar.js » ('j') | chrome/content/ui/sidebar.js » ('J')

Powered by Google App Engine
This is Rietveld