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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 case "clickhide-move": | 700 case "clickhide-move": |
701 if (clickHideFiltersDialog) | 701 if (clickHideFiltersDialog) |
702 { | 702 { |
703 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s
tyle.left, 10) + msg.x) + "px"; | 703 clickHideFiltersDialog.style.left = (parseInt(clickHideFiltersDialog.s
tyle.left, 10) + msg.x) + "px"; |
704 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st
yle.top, 10) + msg.y) + "px"; | 704 clickHideFiltersDialog.style.top = (parseInt(clickHideFiltersDialog.st
yle.top, 10) + msg.y) + "px"; |
705 } | 705 } |
706 break; | 706 break; |
707 case "clickhide-close": | 707 case "clickhide-close": |
708 if (currentElement && msg.remove) | 708 if (currentElement && msg.remove) |
709 { | 709 { |
710 // Explicitly get rid of currentElement | 710 // Hide the selected element itself if an added blocking |
711 var element = currentElement.prisoner || currentElement; | 711 // filter is causing it to collapse. Note that this |
712 if (element && element.parentNode) | 712 // behavior is incomplete, but the best we can do here, |
713 element.parentNode.removeChild(element); | 713 // e.g. if an added blocking filter matches other elements, |
| 714 // the effect won't be visible until the page is is reloaded. |
| 715 checkCollapse(currentElement.prisoner || currentElement); |
| 716 |
| 717 // Apply added element hiding filters. |
| 718 updateStylesheet(); |
714 } | 719 } |
715 clickHide_deactivate(); | 720 clickHide_deactivate(); |
716 break; | 721 break; |
717 case "clickhide-show-dialog": | 722 case "clickhide-show-dialog": |
718 if (window.self == window.top) | 723 if (window.self == window.top) |
719 clickHide_showDialog(msg.screenX + window.pageXOffset, | 724 clickHide_showDialog(msg.screenX + window.pageXOffset, |
720 msg.screenY + window.pageYOffset, | 725 msg.screenY + window.pageYOffset, |
721 msg.clickHideFilters); | 726 msg.clickHideFilters); |
722 break; | 727 break; |
723 case "clickhide-clear-last-right-click-event": | 728 case "clickhide-clear-last-right-click-event": |
724 if (lastRightClickEventValid) | 729 if (lastRightClickEventValid) |
725 lastRightClickEventValid = false; | 730 lastRightClickEventValid = false; |
726 else | 731 else |
727 lastRightClickEvent = null; | 732 lastRightClickEvent = null; |
728 break; | 733 break; |
729 } | 734 } |
730 }); | 735 }); |
731 | 736 |
732 if (window == window.top) | 737 if (window == window.top) |
733 ext.backgroundPage.sendMessage({type: "report-html-page"}); | 738 ext.backgroundPage.sendMessage({type: "report-html-page"}); |
734 } | 739 } |
OLD | NEW |