mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-03 12:40:00 +00:00
Merge pull request #4142 from gjoyner/tasks
Popovers now disappear when clicking Save & Close
This commit is contained in:
commit
8423de287e
2 changed files with 4 additions and 2 deletions
|
|
@ -64,11 +64,13 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
|||
User.user.ops.deleteTask({params:{id:list[$index].id}})
|
||||
};
|
||||
|
||||
$scope.saveTask = function(task, stayOpen) {
|
||||
$scope.saveTask = function(task, stayOpen, isSaveAndClose) {
|
||||
if (task.checklist)
|
||||
task.checklist = _.filter(task.checklist,function(i){return !!i.text});
|
||||
User.user.ops.updateTask({params:{id:task.id},body:task});
|
||||
if (!stayOpen) task._editing = false;
|
||||
if (isSaveAndClose)
|
||||
$("#task-" + task.id).parent().children('.popover').removeClass('in');
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ li(bindonce='list', bo-id='"task-"+task.id', ng-repeat='task in obj[list.type+"s
|
|||
input.inline-edit(type='text',ng-model='item.text',ui-keydown="{'8 46':'removeChecklistItem(task,$event,$index)'}",ui-keyup="{'13':'addChecklistItem(task,$event,$index)','38 40':'navigateChecklist(task,$index,$event)'}")
|
||||
|
||||
|
||||
form(ng-submit='saveTask(task)')
|
||||
form(ng-submit='saveTask(task,false,true)')
|
||||
// text & notes
|
||||
fieldset.option-group
|
||||
label.option-title=env.t('text')
|
||||
|
|
|
|||
Loading…
Reference in a new issue