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, null)); |
// Apply jQuery UI styles |
$("button").button(); |
@@ -53,7 +53,7 @@ |
if (event.keyCode == 27) |
{ |
event.preventDefault(); |
- closeDialog(); |
+ closeDialog(null); |
} |
else if (event.keyCode == 13 && !event.shiftKey && !event.ctrlKey) |
{ |
@@ -69,10 +69,10 @@ |
.map(function(f) {return f.replace(/^\s+/, "").replace(/\s+$/, "");}) |
.filter(function(f) {return f != "";}); |
ext.backgroundPage.sendMessage({type: "add-filters", filters: filters}); |
- closeDialog(true); |
+ closeDialog(filters); |
} |
-function closeDialog(success) |
+function closeDialog(filters) |
{ |
ext.backgroundPage.sendMessage( |
{ |
@@ -80,7 +80,7 @@ |
payload: |
{ |
type: "clickhide-close", |
- remove: (typeof success == "boolean" ? success : false) |
+ filters: filters |
Wladimir Palant
2014/01/10 16:28:56
Why send the filters and have the other end ignore
Thomas Greiner
2014/07/17 15:35:49
You're right. This is code from earlier approaches
|
} |
} |
); |