mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix chart shown below task edit form
This commit is contained in:
@@ -77,7 +77,7 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
||||
default:
|
||||
$rootScope.charts[id] = !$rootScope.charts[id];
|
||||
history = task.history;
|
||||
if (task) task._editing = false;
|
||||
if (task && task._editing) task._editing = false;
|
||||
}
|
||||
matrix = [['Date', 'Score']];
|
||||
_.each(history, function(obj) {
|
||||
|
||||
@@ -70,6 +70,13 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', '
|
||||
op: "revive"
|
||||
});
|
||||
};
|
||||
|
||||
$scope.toggleEdit = function(task){
|
||||
console.log(task)
|
||||
task._editing = !task._editing;
|
||||
if($rootScope.charts[task.id]) $rootScope.charts[task.id] = false;
|
||||
};
|
||||
|
||||
$scope.remove = function(task) {
|
||||
var tasks;
|
||||
if (confirm("Are you sure you want to delete this task?") !== true) {
|
||||
@@ -82,6 +89,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User', '
|
||||
});
|
||||
tasks.splice(tasks.indexOf(task), 1);
|
||||
};
|
||||
|
||||
/*
|
||||
------------------------
|
||||
Items
|
||||
|
||||
@@ -9,10 +9,10 @@ li(ng-repeat='task in user[list.type + "s"]', class='task {{taskClasses(task,use
|
||||
i.icon-tags(tooltip='{{appliedTags(user.tags, task.tags)}}', ng-hide='noTags(task.tags)')
|
||||
|
||||
// edit
|
||||
a(ng-hide='task._editing', ng-click='task._editing = !task._editing', tooltip='Edit')
|
||||
a(ng-hide='task._editing', ng-click='toggleEdit(task)', tooltip='Edit')
|
||||
i.icon-pencil(ng-hide='task._editing')
|
||||
// cancel
|
||||
a(ng-hide='!task._editing', ng-click='task._editing = !task._editing', tooltip='Cancel')
|
||||
a(ng-hide='!task._editing', ng-click='toggleEdit(task)', tooltip='Cancel')
|
||||
i.icon-remove(ng-hide='!task._editing')
|
||||
//- challenges
|
||||
// {{#if task.challenge}}
|
||||
|
||||
Reference in New Issue
Block a user