remove edit and remove buttons when cookie is gone

pull/16/head
Martin Zimmermann 11 years ago
parent 0b8cac7f18
commit 0abb8ed658

@ -171,12 +171,6 @@ define(["behave", "app/text/html", "app/dom", "app/utils", "app/api", "app/marku
});
});
if (! utils.cookie(comment.id)) {
$("a.edit", footer).remove();
$("a.delete", footer).remove();
return;
}
$("a.edit", footer).toggle("click",
function(toggler) {
var edit = $("a.edit", footer);
@ -235,6 +229,18 @@ define(["behave", "app/text/html", "app/dom", "app/utils", "app/api", "app/marku
}, 1500);
}
});
// remove edit and delete buttons when cookie is gone
var clear = function(button) {
if (! utils.cookie(comment.id)) {
$(button, footer).remove();
} else {
setTimeout(function() { clear(button); }, 15*1000);
}
};
clear("a.edit");
clear("a.delete");
};
return {

Loading…
Cancel
Save