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

Unified Diff: block.js

Issue 5838948538515456: Issue 370 - Make "Block element" hide elements for added filters (Closed)
Patch Set: Created March 4, 2015, 10:19 a.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 | « background.js ('k') | include.postload.js » ('j') | include.postload.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: block.js
===================================================================
--- a/block.js
+++ b/block.js
@@ -24,7 +24,7 @@
window.addEventListener("dragend", onDragEnd, false);
$("#addButton").click(addFilters);
- $("#cancelButton").click(closeDialog.bind(null, false));
+ $("#cancelButton").click(closeDialog.bind(null, false, []));
// Apply jQuery UI styles
$("button").button();
@@ -54,7 +54,7 @@
if (event.keyCode == 27)
{
event.preventDefault();
- closeDialog();
+ closeDialog(false, []);
}
else if (event.keyCode == 13 && !event.shiftKey && !event.ctrlKey)
{
@@ -74,14 +74,14 @@
function(response)
{
if (response.status == "ok")
- closeDialog(true);
+ closeDialog(true, response.selectors);
else
alert(response.error);
}
);
}
-function closeDialog(success)
+function closeDialog(success, selectors)
{
ext.backgroundPage.sendMessage(
{
@@ -89,7 +89,8 @@
payload:
{
type: "clickhide-close",
- remove: (typeof success == "boolean" ? success : false)
+ remove: (typeof success == "boolean" ? success : false),
+ selectors: selectors
}
}
);
« no previous file with comments | « background.js ('k') | include.postload.js » ('j') | include.postload.js » ('J')

Powered by Google App Engine
This is Rietveld