summaryrefslogtreecommitdiffstats
path: root/apps/tasks/js/tasks.js
diff options
context:
space:
mode:
authorBrice Maron <brice@bmaron.net>2012-06-21 20:19:31 +0000
committerBrice Maron <brice@bmaron.net>2012-06-21 20:19:31 +0000
commita5938e4e3766bb7502a3493661ed3bac662f5182 (patch)
tree02fcbe206788e471f122158730004554afec83c5 /apps/tasks/js/tasks.js
parent84b9ac2678e6a0b014b730896a12d1531789d8da (diff)
parent37d12144c2debd27271378d2adc5c2b65a25e1f7 (diff)
downloadnextcloud-server-a5938e4e3766bb7502a3493661ed3bac662f5182.tar.gz
nextcloud-server-a5938e4e3766bb7502a3493661ed3bac662f5182.zip
Merge branch 'master' into multi_app_dir
Diffstat (limited to 'apps/tasks/js/tasks.js')
-rw-r--r--apps/tasks/js/tasks.js30
1 files changed, 15 insertions, 15 deletions
diff --git a/apps/tasks/js/tasks.js b/apps/tasks/js/tasks.js
index 6547b80981c..bc92965bb0b 100644
--- a/apps/tasks/js/tasks.js
+++ b/apps/tasks/js/tasks.js
@@ -97,8 +97,10 @@ OC.Tasks = {
due.find('.time').timepicker('setTime', date.getHours()+':'+date.getMinutes());
}
}
+ var delete_action = task_container.find('.task_delete').click(OC.Tasks.deleteClickHandler);
$('<div>')
.addClass('more')
+ .append(delete_action)
.append(description)
.append(due)
.appendTo(task_container);
@@ -273,6 +275,19 @@ OC.Tasks = {
$task.find('div.location').show();
$task.find('input.location').hide();
},
+ deleteClickHandler:function(event){
+ var $task = $(this).closest('.task'),
+ task = $task.data('task');
+ $.post(OC.filePath('tasks', 'ajax', 'delete.php'),{'id':task.id},function(jsondata){
+ if(jsondata.status == 'success'){
+ $task.remove();
+ }
+ else{
+ alert(jsondata.data.message);
+ }
+ });
+ return false;
+ },
complete_task:function() {
var $task = $(this).closest('.task'),
task = $task.data('task'),
@@ -441,21 +456,6 @@ $(document).ready(function(){
});
});
- $('#tasks_delete').live('click',function(){
- var id = $('#task_details').data('id');
- $.post('ajax/delete.php',{'id':id},function(jsondata){
- if(jsondata.status == 'success'){
- $('#tasks [data-id="'+jsondata.data.id+'"]').remove();
- $('#task_details').data('id','');
- $('#task_details').html('');
- }
- else{
- alert(jsondata.data.message);
- }
- });
- return false;
- });
-
$('#tasks_addtask').click(function(){
var input = $('#tasks_newtask').val();
$.post(OC.filePath('tasks', 'ajax', 'addtask.php'),{text:input},function(jsondata){