Index: include.postload.js |
=================================================================== |
--- a/include.postload.js |
+++ b/include.postload.js |
@@ -309,11 +309,7 @@ |
{ |
// If we are already selecting, abort now |
if (clickHide_activated || clickHideFiltersDialog) |
- { |
- var savedElement = (currentElement.prisoner ? currentElement.prisoner : currentElement); |
- clickHide_deactivate(); |
- currentElement = savedElement; |
- } |
+ clickHide_deactivate(true); |
clickHide_filters = filters; |
@@ -375,7 +371,7 @@ |
} |
// Turn off click-to-hide |
-function clickHide_deactivate() |
+function clickHide_deactivate(keepOverlays) |
{ |
if (clickHideFiltersDialog) |
{ |
@@ -383,15 +379,6 @@ |
clickHideFiltersDialog = null; |
} |
- if(currentElement) { |
- currentElement.removeEventListener("contextmenu", clickHide_elementClickHandler, true); |
- unhighlightElements(); |
- unhighlightElement(currentElement); |
- currentElement = null; |
- clickHideFilters = null; |
- } |
- unhighlightElements(); |
- |
clickHide_activated = false; |
clickHide_filters = null; |
if(!document) |
@@ -401,11 +388,21 @@ |
document.removeEventListener("click", clickHide_mouseClick, true); |
document.removeEventListener("keydown", clickHide_keyDown, true); |
- // Remove overlays |
- // For some reason iterating over the array returend by getElementsByClassName() doesn't work |
- var elt; |
- while(elt = document.querySelector('.__adblockplus__overlay')) |
- elt.parentNode.removeChild(elt); |
+ if (!keepOverlays) |
+ { |
+ if (currentElement) { |
+ currentElement.removeEventListener("contextmenu", clickHide_elementClickHandler, true); |
+ unhighlightElements(); |
+ unhighlightElement(currentElement); |
+ currentElement = null; |
+ clickHideFilters = null; |
+ } |
+ unhighlightElements(); |
+ |
+ var overlays = document.getElementsByClassName("__adblockplus__overlay"); |
+ while (overlays.length > 0) |
+ overlays[0].parentNode.removeChild(overlays[0]); |
+ } |
} |
function clickHide_elementClickHandler(ev) { |