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

Side by Side Diff: chrome/content/ui/sidebar.js

Issue 29334565: Issue 1950 - Fixed: Filter tooltip not shown for long filters (Closed)
Patch Set: Created Jan. 29, 2016, 6:26 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/content/ui/filters-filteractions.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 cacheStorage = null; 242 cacheStorage = null;
243 } 243 }
244 244
245 // Fills a box with text splitting it up into multiple lines if necessary 245 // Fills a box with text splitting it up into multiple lines if necessary
246 function setMultilineContent(box, text, noRemove) 246 function setMultilineContent(box, text, noRemove)
247 { 247 {
248 if (!noRemove) 248 if (!noRemove)
249 while (box.firstChild) 249 while (box.firstChild)
250 box.removeChild(box.firstChild); 250 box.removeChild(box.firstChild);
251 251
252 for (var i = 0; i < text.length; i += 80) 252 let lines = text.match(/.{1,80}/g);
253 if (lines.length > 7)
253 { 254 {
254 var description = document.createElement("description"); 255 // Text is too long to display in full so we cut out the middle part
255 description.setAttribute("value", text.substr(i, 80)); 256 lines = lines.slice(0,3).concat("\u2026", lines.slice(-3));
257 }
258
259 for (let line of lines)
260 {
261 let description = document.createElement("description");
262 description.setAttribute("value", line);
256 box.appendChild(description); 263 box.appendChild(description);
257 } 264 }
258 } 265 }
259 266
260 // Fill in tooltip data before showing it 267 // Fill in tooltip data before showing it
261 function fillInTooltip(e) { 268 function fillInTooltip(e) {
262 // Prevent tooltip from overlapping menu 269 // Prevent tooltip from overlapping menu
263 if (E("context").state == "open") 270 if (E("context").state == "open")
264 { 271 {
265 e.preventDefault(); 272 e.preventDefault();
(...skipping 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 return {tooltip: this.itemsDummyTooltip}; 1316 return {tooltip: this.itemsDummyTooltip};
1310 }, 1317 },
1311 1318
1312 invalidateItem: function(item) 1319 invalidateItem: function(item)
1313 { 1320 {
1314 let row = this.data.indexOf(item); 1321 let row = this.data.indexOf(item);
1315 if (row >= 0) 1322 if (row >= 0)
1316 this.boxObject.invalidateRow(row); 1323 this.boxObject.invalidateRow(row);
1317 } 1324 }
1318 } 1325 }
OLDNEW
« no previous file with comments | « chrome/content/ui/filters-filteractions.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld