mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Put list back into removeTask function, update removal logic within challengeCtrl
This commit is contained in:
@@ -186,11 +186,11 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
|||||||
delete listDef.newTask;
|
delete listDef.newTask;
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.removeTask = function(list, $index) {
|
$scope.removeTask = function(task, list) {
|
||||||
if (!confirm(window.env.t('sureDelete'))) return;
|
if (!confirm(window.env.t('sureDelete'))) return;
|
||||||
//TODO persist
|
//TODO persist
|
||||||
// User.log({op: "delTask", data: task});
|
// User.log({op: "delTask", data: task});
|
||||||
list.splice($index, 1);
|
_.remove(list, task);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.saveTask = function(task){
|
$scope.saveTask = function(task){
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s
|
|||||||
span.glyphicon.glyphicon-bullhorn(tooltip=env.t('challenge'))
|
span.glyphicon.glyphicon-bullhorn(tooltip=env.t('challenge'))
|
||||||
|
|
|
|
||||||
// delete
|
// delete
|
||||||
a(ng-if='!task.challenge.id', ng-click='removeTask(task)', tooltip=env.t('delete'))
|
a(ng-if='!task.challenge.id', ng-click='removeTask(task, obj[list.type+"s"])', tooltip=env.t('delete'))
|
||||||
span.glyphicon.glyphicon-trash
|
span.glyphicon.glyphicon-trash
|
||||||
|
|
|
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ li(bindonce='list', id='task-{{::task.id}}', ng-repeat='task in obj[list.type+"s
|
|||||||
p
|
p
|
||||||
a(ng-click='unlink(task, "keep")')=env.t('keepIt')
|
a(ng-click='unlink(task, "keep")')=env.t('keepIt')
|
||||||
|
|
|
|
||||||
a(ng-click="removeTask(task)")=env.t('removeIt')
|
a(ng-click='removeTask(task, obj[list.type+"s"])')=env.t('removeIt')
|
||||||
div(ng-if='task.challenge.broken=="CHALLENGE_DELETED"')
|
div(ng-if='task.challenge.broken=="CHALLENGE_DELETED"')
|
||||||
p
|
p
|
||||||
|
|
|
|
||||||
|
|||||||
Reference in New Issue
Block a user