Skip to content

Commit

Permalink
fixed delete item link
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander committed Mar 5, 2014
1 parent aa2f149 commit 97a4828
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chat_filter.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,8 +547,8 @@ function initialize_ui(){

function add_item_to_ui(new_word){
$('#list-' + option.name + ' .list-inner')
.append('<span>' + new_word + ' <a href="#" id="list-' + option.name + '-' + new_word + '">[X]</id><br/></span>');
$("#list-" + option.name + "-" + new_word).click(function(e){
.append('<span>' + new_word + ' <a href="#" id="list-' + option.name + '-' + option.element.indexOf(new_word) + '">[X]</id><br/></span>');
$("#list-" + option.name + "-" + option.element.indexOf(new_word)).click(function(e){
e.preventDefault();
option.element.splice(option.element.indexOf(new_word), 1);
localStorage.setItem("tpp-custom-filter-" + option.name, JSON.stringify(option.element));
Expand Down

0 comments on commit 97a4828

Please sign in to comment.