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

Delta Between Two Patch Sets: include.postload.js

Issue 6194342989398016: Issue 2298 - Fixed: "Block element" from context menu doesn't reset previous state (Closed)
Left Patch Set: Created April 10, 2015, 11:07 a.m.
Right Patch Set: Cleanup lastRightClickEvent Created April 10, 2015, 11:32 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
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
360 clickHide_filters = null; 361 clickHide_filters = null;
362 lastRightClickEvent = null;
361 363
362 if (currentElement) 364 if (currentElement)
363 { 365 {
364 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true); 366 currentElement.removeEventListener("contextmenu", clickHide_elementClickHan dler, true);
365 unhighlightElements(); 367 unhighlightElements();
366 unhighlightElement(currentElement); 368 unhighlightElement(currentElement);
367 currentElement = null; 369 currentElement = null;
368 } 370 }
369 unhighlightElements(); 371 unhighlightElements();
370 372
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 break; 690 break;
689 case "clickhide-activate": 691 case "clickhide-activate":
690 clickHide_activate(); 692 clickHide_activate();
691 break; 693 break;
692 case "clickhide-deactivate": 694 case "clickhide-deactivate":
693 clickHide_deactivate(); 695 clickHide_deactivate();
694 break; 696 break;
695 case "clickhide-new-filter": 697 case "clickhide-new-filter":
696 if(lastRightClickEvent) 698 if(lastRightClickEvent)
697 { 699 {
698 getBlockableElementOrAncestor(lastRightClickEvent.target, function(ele ment) 700 var event = lastRightClickEvent;
701 getBlockableElementOrAncestor(event.target, function(element)
699 { 702 {
700 clickHide_activate(); 703 clickHide_activate();
701 currentElement = element; 704 currentElement = element;
702 clickHide_mouseClick(lastRightClickEvent); 705 clickHide_mouseClick(event);
703 }); 706 });
704 } 707 }
705 break; 708 break;
706 case "clickhide-init": 709 case "clickhide-init":
707 if (clickHideFiltersDialog) 710 if (clickHideFiltersDialog)
708 { 711 {
709 sendResponse({filters: clickHide_filters}); 712 sendResponse({filters: clickHide_filters});
710 713
711 clickHideFiltersDialog.style.width = msg.width + "px"; 714 clickHideFiltersDialog.style.width = msg.width + "px";
712 clickHideFiltersDialog.style.height = msg.height + "px"; 715 clickHideFiltersDialog.style.height = msg.height + "px";
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
748 lastRightClickEventValid = false; 751 lastRightClickEventValid = false;
749 else 752 else
750 lastRightClickEvent = null; 753 lastRightClickEvent = null;
751 break; 754 break;
752 } 755 }
753 }); 756 });
754 757
755 if (window == window.top) 758 if (window == window.top)
756 ext.backgroundPage.sendMessage({type: "report-html-page"}); 759 ext.backgroundPage.sendMessage({type: "report-html-page"});
757 } 760 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld