-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
filterfun.js
34 lines (22 loc) · 855 Bytes
/
filterfun.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
function filterfun(){
document.getElementById("filterdata").innerHTML = ""
for (i=0;i<filterarray.length;i++){
var button = document.createElement("button")
button.id = filterarray[i].id;
button.innerHTML = "Type: "+filterarray[i].type + " | " + "FrameStart: " + filterarray[i].startvalue+ " | " +"FrameEnd: " + filterarray[i].endvalue
button.className = "list-group-item list-group-item-action"
button.classList.add("backgroundclass")
button.type = "button"
document.getElementById("filterdata").appendChild(button)
button.addEventListener("dblclick", function(event){
document.getElementById("filterdata").innerHTML = ""
for (j=0;j<filterarray.length;j++){
if(parseInt(filterarray[j].id)===parseInt(event.target.id)){
filterarray.splice(j, 1)
event.target.remove();
filterfun();
}
}
})
}
}