summaryrefslogtreecommitdiffstats
path: root/static/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'static/script.js')
-rw-r--r--static/script.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/static/script.js b/static/script.js
index c9d3c40..81d7fc5 100644
--- a/static/script.js
+++ b/static/script.js
@@ -156,7 +156,7 @@ function add(id, title) {
<a href="http://www.youtube.com/watch?v=' + id + '">' + title + '</a>\
</div>\
<div class="user">' + user + '</div>\
- <div class="remove">×</div>\
+ <div class="remove" onclick="remove(\'' + id + '\')">×</div>\
<br class="clear">\
<div class="thumb">\
<img src="http://i.ytimg.com/vi/' + id + '/1.jpg" alt="' + id + '">\
@@ -183,6 +183,12 @@ function remove(id) {
}
$.getJSON('/remove/', params,
function(data) {
+ if (data == 1) {
+ var element = $('#' + id);
+ element.slideUp(100, function() {
+ element.remove();
+ });
+ }
}
);
}