Tasks: Add input to edit the task location

This commit is contained in:
Bart Visscher 2012-04-27 20:26:12 +02:00
parent c627657fc6
commit 6e7f5ec4ce
3 changed files with 22 additions and 2 deletions

View file

@ -25,6 +25,10 @@ switch($property) {
$description = $_POST['description'];
$vtodo->setString('DESCRIPTION', $description);
break;
case 'location':
$location = $_POST['location'];
$vtodo->setString('LOCATION', $location);
break;
case 'categories':
$categories = $_POST['categories'];
$vtodo->setString('CATEGORIES', $categories);

View file

@ -40,12 +40,13 @@
.task .tag.active{border-color:black;opacity:0.6;}
.task .tag.active:hover{opacity:0.8;}
.task .categories{position:absolute;right:6em;text-align:right;top:0.4em}
.task .categories{position:absolute;right:12em;text-align:right;top:0.4em}
.task .categories a{background-color:#1d2d44;color:white;}
.task .categories .tag.active{display:none;}
.task input.categories{display:none;top:0;text-align:left;}
.task .location{background-color:#442d44;color:white;position:absolute;right:0.6em;width:4.2em;text-align:left;top:0.4em}
.task .location{background-color:#442d44;color:white;position:absolute;right:0.6em;width:9.2em;text-align:left;top:0.4em}
.task input.location{display:none;top:0;text-align:left;right:0.3em;background-color:white;color:#333333;}
.task .more{display:none;margin-top:0.5em;}

View file

@ -117,6 +117,19 @@ OC.Tasks = {
});
})
.appendTo(task_container);
$('<input placeholder="'+t('tasks', 'Location')+'">')
.addClass('location')
.val(task.location)
.blur(function(){
var task = $(this).closest('.task').data('task');
var location = $(this).val();
$.post('ajax/update_property.php', {id:task.id, type:'location', location:location}, function(jsondata){
if(jsondata.status == 'success') {
task.location = location;
}
});
})
.appendTo(task_container);
return task_container;
},
filter:function(tag, find_filter) {
@ -237,6 +250,8 @@ OC.Tasks = {
$task.find('.more').show();
$task.find('div.categories').hide();
$task.find('input.categories').show();
$task.find('div.location').hide();
$task.find('input.location').show();
},
complete_task:function() {
var $task = $(this).closest('.task'),