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

Side by Side Diff: include.postload.js

Issue 4786968105844736: Noissue - Don't call unhighlightElements() twice (Closed)
Patch Set: Created April 10, 2015, 11:14 a.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 | « no previous file | 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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 } 355 }
356 356
357 function clickHide_deactivate() 357 function clickHide_deactivate()
358 { 358 {
359 clickHide_rulesPending(); 359 clickHide_rulesPending();
360 clickHide_filters = null; 360 clickHide_filters = null;
361 361
362 if (currentElement) 362 if (currentElement)
363 { 363 {
364 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true); 364 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true);
365 unhighlightElements();
Sebastian Noack 2015/04/10 11:17:38 Unfortunatelly, the patch misses some context. Thi
366 unhighlightElement(currentElement); 365 unhighlightElement(currentElement);
367 currentElement = null; 366 currentElement = null;
368 } 367 }
369 unhighlightElements(); 368 unhighlightElements();
370 369
371 var overlays = document.getElementsByClassName("__adblockplus__overlay"); 370 var overlays = document.getElementsByClassName("__adblockplus__overlay");
372 while (overlays.length > 0) 371 while (overlays.length > 0)
373 overlays[0].parentNode.removeChild(overlays[0]); 372 overlays[0].parentNode.removeChild(overlays[0]);
374 373
375 ext.onExtensionUnloaded.removeListener(clickHide_deactivate); 374 ext.onExtensionUnloaded.removeListener(clickHide_deactivate);
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 lastRightClickEventValid = false; 747 lastRightClickEventValid = false;
749 else 748 else
750 lastRightClickEvent = null; 749 lastRightClickEvent = null;
751 break; 750 break;
752 } 751 }
753 }); 752 });
754 753
755 if (window == window.top) 754 if (window == window.top)
756 ext.backgroundPage.sendMessage({type: "report-html-page"}); 755 ext.backgroundPage.sendMessage({type: "report-html-page"});
757 } 756 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld