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

Unified Diff: include.postload.js

Issue 5838948538515456: Issue 370 - Make "Block element" hide elements for added filters (Closed)
Patch Set: Improved comment Created March 4, 2015, 7:34 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « block.js ('k') | include.preload.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include.postload.js
===================================================================
--- a/include.postload.js
+++ b/include.postload.js
@@ -707,10 +707,17 @@
case "clickhide-close":
if (currentElement && msg.remove)
{
- // Explicitly get rid of currentElement
- var element = currentElement.prisoner || currentElement;
- if (element && element.parentNode)
- element.parentNode.removeChild(element);
+ // Hide the selected element itself if an added blocking
+ // filter is causing it to collapse. Note that this
+ // behavior is incomplete, but the best we can do here,
+ // e.g. if an added blocking filter matches other elements,
+ // the effect won't be visible until the page is is reloaded.
+ checkCollapse(currentElement.prisoner || currentElement);
+
+ // Apply added element hiding filters.
+ var selectors = msg.selectors;
+ if (selectors.length > 0)
+ hideElements(selectors);
}
clickHide_deactivate();
break;
« no previous file with comments | « block.js ('k') | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld