diff options
author | NateN1222 <nathannichols454@gmail.com> | 2017-08-30 13:57:57 -0500 |
---|---|---|
committer | NateN1222 <nathannichols454@gmail.com> | 2017-08-30 13:57:57 -0500 |
commit | 102e411ccfc62fefe6205a2b54f67da64b29f878 (patch) | |
tree | a39fe24ec4f69b54f01ef35b80c0436d310ac19d /html | |
parent | 31cd377ee12ec4f2364ee0c0ea7c8763f98f927c (diff) |
Made the blacklist/whitelist/forget preference buttons in the GUI work
Diffstat (limited to 'html')
-rw-r--r-- | html/display_panel/content/main_panel.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/html/display_panel/content/main_panel.js b/html/display_panel/content/main_panel.js index a0877a3..fbdd047 100644 --- a/html/display_panel/content/main_panel.js +++ b/html/display_panel/content/main_panel.js @@ -82,20 +82,20 @@ function write_elements(data,name,color){ for(var i = 0; i < data[name].length; i++){ // Make sure this causes generate_html to get called again with updated data document.getElementById(name+"_"+i).addEventListener("click",function(info){ - var temp = current_blocked_data[name][parseInt(info.path[0].id.match(/\d/g)[0])]; + var temp = current_blocked_data[name][parseInt(info.target.id.match(/\d/g)[0])]; console.log("Moving script " + temp[0] + " to blacklist"); var script_name = this.parentElement.parentElement.parentElement.parentElement.id; myPort.postMessage({"blacklist": temp}); }); document.getElementById(name+"_2_"+i).addEventListener("click",function(info){ - var temp = current_blocked_data[name][parseInt(info.path[0].id.match(/\d/g)[1])]; + var temp = current_blocked_data[name][parseInt(info.target.id.match(/\d+/g)[1])]; console.log("Moving script " + temp[0] + " to whitelist"); var script_name = this.parentElement.parentElement.parentElement.parentElement.id; myPort.postMessage({"whitelist": temp}); }); document.getElementById(name+"_3_"+i).addEventListener("click",function(info){ - var temp = current_blocked_data[name][parseInt(info.path[0].id.match(/\d/g)[1])]; + var temp = current_blocked_data[name][parseInt(info.target.id.match(/\d/g)[1])]; console.log("Forget preferences for script " + temp[0]); var script_name = this.parentElement.parentElement.parentElement.parentElement.id; if(this.parentElement.parentElement.innerHTML.indexOf("Refresh the page") == -1){ |