Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
implement task deletion
  • Loading branch information
mrtazz committed Dec 27, 2010
1 parent 20ad0db commit 6c1f538
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
Binary file added _attachments/images/trash.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions evently/tasks/setTasks/mustache.html
Expand Up @@ -4,6 +4,9 @@
<input type="checkbox" class="checkdone" {{#checked}}checked="checked"{{/checked}}/>
<span class="title">{{title}}</span> <span class="tags">{{tags}}</span>
<div class="taskeditor hidden" docid="{{_id}}">
<a class="deletebutton" href="#">
<img src="images/trash.png" width="20" height="25">
</a>
<form class="edittaskform" action="">
<fieldset class="leftcolumn">
<li>
Expand Down
18 changes: 18 additions & 0 deletions evently/tasks/setTasks/selectors/a.deletebutton/click.js
@@ -0,0 +1,18 @@
function()
{
// get associated document and delete it
var app = $$(this).app;
var box = this;
var docid = this.parentNode.getAttribute("docid");
app.db.openDoc(docid, {
success: function(d)
{
app.db.removeDoc(d, {
success: function(r)
{
$('li[docid|="'+docid+'"]').slideUp("fast");
}
});
}
});
}

0 comments on commit 6c1f538

Please sign in to comment.