Left: | ||
Right: |
OLD | NEW |
---|---|
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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
350 document.removeEventListener("mouseleave", clickHide_stopPropagation, true); | 350 document.removeEventListener("mouseleave", clickHide_stopPropagation, true); |
351 document.removeEventListener("mouseover", clickHide_mouseOver, true); | 351 document.removeEventListener("mouseover", clickHide_mouseOver, true); |
352 document.removeEventListener("mouseout", clickHide_mouseOut, true); | 352 document.removeEventListener("mouseout", clickHide_mouseOut, true); |
353 document.removeEventListener("click", clickHide_mouseClick, true); | 353 document.removeEventListener("click", clickHide_mouseClick, true); |
354 document.removeEventListener("keydown", clickHide_keyDown, true); | 354 document.removeEventListener("keydown", clickHide_keyDown, true); |
355 } | 355 } |
356 | 356 |
357 function clickHide_deactivate() | 357 function clickHide_deactivate() |
358 { | 358 { |
359 clickHide_rulesPending(); | 359 clickHide_rulesPending(); |
360 | |
361 clickHide_filters = null; | 360 clickHide_filters = null; |
362 lastRightClickEvent = null; | |
Sebastian Noack
2015/04/10 11:11:17
In case you wonder, resetting the lastRightClickEv
Sebastian Noack
2015/04/10 11:32:49
Never mind. I reverted my decision. Cleaning up ma
| |
363 | 361 |
364 if (currentElement) | 362 if (currentElement) |
365 { | 363 { |
366 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true); | 364 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true); |
367 unhighlightElements(); | 365 unhighlightElements(); |
368 unhighlightElement(currentElement); | 366 unhighlightElement(currentElement); |
369 currentElement = null; | 367 currentElement = null; |
370 } | 368 } |
371 unhighlightElements(); | 369 unhighlightElements(); |
372 | 370 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
692 clickHide_activate(); | 690 clickHide_activate(); |
693 break; | 691 break; |
694 case "clickhide-deactivate": | 692 case "clickhide-deactivate": |
695 clickHide_deactivate(); | 693 clickHide_deactivate(); |
696 break; | 694 break; |
697 case "clickhide-new-filter": | 695 case "clickhide-new-filter": |
698 if(lastRightClickEvent) | 696 if(lastRightClickEvent) |
699 { | 697 { |
700 getBlockableElementOrAncestor(lastRightClickEvent.target, function(ele ment) | 698 getBlockableElementOrAncestor(lastRightClickEvent.target, function(ele ment) |
701 { | 699 { |
702 clickHide_activated = true; | 700 clickHide_activate(); |
703 currentElement = element; | 701 currentElement = element; |
704 clickHide_mouseClick(lastRightClickEvent); | 702 clickHide_mouseClick(lastRightClickEvent); |
705 }); | 703 }); |
706 } | 704 } |
707 break; | 705 break; |
708 case "clickhide-init": | 706 case "clickhide-init": |
709 if (clickHideFiltersDialog) | 707 if (clickHideFiltersDialog) |
710 { | 708 { |
711 sendResponse({filters: clickHide_filters}); | 709 sendResponse({filters: clickHide_filters}); |
712 | 710 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
750 lastRightClickEventValid = false; | 748 lastRightClickEventValid = false; |
751 else | 749 else |
752 lastRightClickEvent = null; | 750 lastRightClickEvent = null; |
753 break; | 751 break; |
754 } | 752 } |
755 }); | 753 }); |
756 | 754 |
757 if (window == window.top) | 755 if (window == window.top) |
758 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 756 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
759 } | 757 } |
OLD | NEW |