diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-04-27 20:26:12 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-04-27 20:26:12 +0200 |
commit | 6e7f5ec4ce45775ebc99482c5d38fb5acfc95f8b (patch) | |
tree | d229925bb112a4949914831106c397cf57ac0dd0 /apps/tasks | |
parent | c627657fc66f827646d32397b96b8a8790add55d (diff) | |
download | nextcloud-server-6e7f5ec4ce45775ebc99482c5d38fb5acfc95f8b.tar.gz nextcloud-server-6e7f5ec4ce45775ebc99482c5d38fb5acfc95f8b.zip |
Tasks: Add input to edit the task location
Diffstat (limited to 'apps/tasks')
-rw-r--r-- | apps/tasks/ajax/update_property.php | 4 | ||||
-rw-r--r-- | apps/tasks/css/style.css | 5 | ||||
-rw-r--r-- | apps/tasks/js/tasks.js | 15 |
3 files changed, 22 insertions, 2 deletions
diff --git a/apps/tasks/ajax/update_property.php b/apps/tasks/ajax/update_property.php index a14816be127..b075489bd17 100644 --- a/apps/tasks/ajax/update_property.php +++ b/apps/tasks/ajax/update_property.php @@ -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); diff --git a/apps/tasks/css/style.css b/apps/tasks/css/style.css index 6bc1213649c..95dec3f8d08 100644 --- a/apps/tasks/css/style.css +++ b/apps/tasks/css/style.css @@ -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;} diff --git a/apps/tasks/js/tasks.js b/apps/tasks/js/tasks.js index 43d7284f794..197988f79a8 100644 --- a/apps/tasks/js/tasks.js +++ b/apps/tasks/js/tasks.js @@ -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'), |