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: Addressed comments and simplified loop Created March 4, 2015, 9:35 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 | « no previous file | 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,15 @@
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.
+ updateStylesheet();
}
clickHide_deactivate();
break;
« no previous file with comments | « no previous file | include.preload.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld