mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
add auto-focus when single/multiple is toggled
This commit is contained in:
@@ -45,6 +45,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
addTask(addTo, listDef, listDef.newTask);
|
||||
}
|
||||
delete listDef.newTask;
|
||||
delete listDef.focus;
|
||||
};
|
||||
|
||||
$scope.toggleBulk = function(list) {
|
||||
@@ -52,6 +53,7 @@ habitrpg.controller("TasksCtrl", ['$scope', '$rootScope', '$location', 'User','N
|
||||
list.bulk = false;
|
||||
}
|
||||
list.bulk = !list.bulk;
|
||||
list.focus = true;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,8 +24,8 @@ script(id='templates/habitrpg-tasks.html', type="text/ng-template")
|
||||
|
||||
// Add New
|
||||
form.task-add(name='new{{list.type}}form', ng-hide='obj._locked', ng-submit='addTask(obj[list.type+"s"],list)')
|
||||
textarea(rows='6', ng-model='list.newTask', placeholder='{{list.placeHolderBulk}}', ng-if='list.bulk', ui-keydown='{"meta-enter ctrl-enter":"addTask(obj[list.type+\'s\'],list)"}', required)
|
||||
input(type='text', ng-model='list.newTask', placeholder='{{list.placeHolder}}', ng-if='!list.bulk', required)
|
||||
textarea(rows='6', task-focus='list.bulk && list.focus', ng-model='list.newTask', placeholder='{{list.placeHolderBulk}}', ng-if='list.bulk', ui-keydown='{"meta-enter ctrl-enter":"addTask(obj[list.type+\'s\'],list)"}', required)
|
||||
input(type='text', task-focus='!list.bulk && list.focus', ng-model='list.newTask', placeholder='{{list.placeHolder}}', ng-if='!list.bulk', required)
|
||||
button(type='submit', ng-disabled='new{{list.type}}form.$invalid')
|
||||
span.glyphicon.glyphicon-plus
|
||||
small.help-block.btn-link.pull-right(ng-click='toggleBulk(list)')
|
||||
|
||||
Reference in New Issue
Block a user