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

Unified Diff: block.js

Issue 5088751004942336: Issue 370 - Right-clicked element is removed independent of created filter (Closed)
Patch Set: Rebase to rev 3c9cea80c481 Created July 18, 2014, 8:54 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 | « block.html ('k') | chrome/ext/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: block.js
===================================================================
--- a/block.js
+++ b/block.js
@@ -1,6 +1,6 @@
/*
* This file is part of Adblock Plus <http://adblockplus.org/>,
- * Copyright (C) 2006-2013 Eyeo GmbH
+ * Copyright (C) 2006-2014 Eyeo GmbH
*
* Adblock Plus is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
@@ -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();
@@ -46,14 +46,14 @@
document.getElementById("filters").focus();
}
-$(init);
+window.addEventListener("load", init, false);
function onKeyDown(event)
{
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
}
}
);
« no previous file with comments | « block.html ('k') | chrome/ext/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld