orginizer/todolist/static/js/script.js
2017-12-06 11:56:54 +03:00

26 lines
603 B
JavaScript

$(function() {
$('input[type="checkbox"]').click(function() {
$.ajax({
data: $(this).parent().serialize() ,
type: 'POST'
});
if ($(this).parent().css("text-decoration-line") == "none") {
$(this).parent().css("text-decoration-line", "line-through")}
else {
$(this).parent().css("text-decoration-line", "none");
}
});
$('a.delete').click(function() {
$.ajax({
data: $(this).parent().serialize(),
type: 'POST',
url: 'delete/'
});
//todo: если success
$(this).parent().remove();
})
});