Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/tasks.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorRaimund Schlüßler <raimund.schluessler@googlemail.com>2016-08-11 01:09:08 +0300
committerRaimund Schlüßler <raimund.schluessler@googlemail.com>2016-08-11 01:09:08 +0300
commit1097aa14f180e3997f2ce603ca40a3c6fb11f431 (patch)
tree28174cc307cbca3433bafddef1e6d9f2f280a5e7 /js
parent7eb3fd22609ec2e80228873e4a1db76b64a1c770 (diff)
Autofocus input fields on calendar edit and creation
Diffstat (limited to 'js')
-rw-r--r--js/app/controllers/listcontroller.js17
-rw-r--r--js/public/app.js17
2 files changed, 24 insertions, 10 deletions
diff --git a/js/app/controllers/listcontroller.js b/js/app/controllers/listcontroller.js
index 03cfa210..ed0a7ba2 100644
--- a/js/app/controllers/listcontroller.js
+++ b/js/app/controllers/listcontroller.js
@@ -21,14 +21,14 @@
angular.module('Tasks').controller('ListController', [
'$scope', '$rootScope', '$window', '$routeParams', 'ListsModel', 'TasksBusinessLayer', 'CollectionsModel', 'ListsBusinessLayer', '$location',
- 'SearchBusinessLayer', 'CalendarService', 'TasksModel',
+ 'SearchBusinessLayer', 'CalendarService', 'TasksModel', '$timeout',
function($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location,
- SearchBusinessLayer, CalendarService, TasksModel) {
+ SearchBusinessLayer, CalendarService, TasksModel, $timeout) {
'use strict';
var ListController;
ListController = (function() {
function ListController(_$scope, $rootScope, _$window, _$routeParams, _$listsmodel, _$tasksbusinesslayer, _$collectionsmodel, _$listsbusinesslayer, $location,
- _$searchbusinesslayer, _$calendarservice, _$tasksmodel) {
+ _$searchbusinesslayer, _$calendarservice, _$tasksmodel, _$timeout) {
this._$scope = _$scope;
this._$window = _$window;
@@ -39,6 +39,7 @@ angular.module('Tasks').controller('ListController', [
this._$collectionsmodel = _$collectionsmodel;
this._$listsbusinesslayer = _$listsbusinesslayer;
this.$location = $location;
+ this._$timeout = _$timeout;
this._$searchbusinesslayer = _$searchbusinesslayer;
this._$calendarservice = _$calendarservice;
this._$scope.collections = this._$collectionsmodel.getAll();
@@ -62,6 +63,9 @@ angular.module('Tasks').controller('ListController', [
_$scope.status.addingList = true;
_$scope.nameError = false;
$('.hasTooltip').tooltip('hide');
+ _$timeout(function() {
+ $('#newList').focus();
+ }, 50);
};
this._$scope.create = function() {
@@ -89,7 +93,10 @@ angular.module('Tasks').controller('ListController', [
_$scope.nameError = false;
$('.hasTooltip').tooltip('hide');
calendar.prepareUpdate();
- return $location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');
+ $location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');
+ _$timeout(function() {
+ $('#list_' + calendar.uri + ' input.edit').focus();
+ }, 50);
};
this._$scope.checkNew = function(event,name) {
@@ -235,6 +242,6 @@ angular.module('Tasks').controller('ListController', [
})();
return new ListController($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location,
- SearchBusinessLayer, CalendarService, TasksModel);
+ SearchBusinessLayer, CalendarService, TasksModel, $timeout);
}
]);
diff --git a/js/public/app.js b/js/public/app.js
index 1116861f..df7893e1 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -579,14 +579,14 @@ angular.module('Tasks').controller('DetailsController', [
angular.module('Tasks').controller('ListController', [
'$scope', '$rootScope', '$window', '$routeParams', 'ListsModel', 'TasksBusinessLayer', 'CollectionsModel', 'ListsBusinessLayer', '$location',
- 'SearchBusinessLayer', 'CalendarService', 'TasksModel',
+ 'SearchBusinessLayer', 'CalendarService', 'TasksModel', '$timeout',
function($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location,
- SearchBusinessLayer, CalendarService, TasksModel) {
+ SearchBusinessLayer, CalendarService, TasksModel, $timeout) {
'use strict';
var ListController;
ListController = (function() {
function ListController(_$scope, $rootScope, _$window, _$routeParams, _$listsmodel, _$tasksbusinesslayer, _$collectionsmodel, _$listsbusinesslayer, $location,
- _$searchbusinesslayer, _$calendarservice, _$tasksmodel) {
+ _$searchbusinesslayer, _$calendarservice, _$tasksmodel, _$timeout) {
this._$scope = _$scope;
this._$window = _$window;
@@ -597,6 +597,7 @@ angular.module('Tasks').controller('ListController', [
this._$collectionsmodel = _$collectionsmodel;
this._$listsbusinesslayer = _$listsbusinesslayer;
this.$location = $location;
+ this._$timeout = _$timeout;
this._$searchbusinesslayer = _$searchbusinesslayer;
this._$calendarservice = _$calendarservice;
this._$scope.collections = this._$collectionsmodel.getAll();
@@ -620,6 +621,9 @@ angular.module('Tasks').controller('ListController', [
_$scope.status.addingList = true;
_$scope.nameError = false;
$('.hasTooltip').tooltip('hide');
+ _$timeout(function() {
+ $('#newList').focus();
+ }, 50);
};
this._$scope.create = function() {
@@ -647,7 +651,10 @@ angular.module('Tasks').controller('ListController', [
_$scope.nameError = false;
$('.hasTooltip').tooltip('hide');
calendar.prepareUpdate();
- return $location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');
+ $location.path('/calendars/' + _$scope.route.calendarID + '/edit/name');
+ _$timeout(function() {
+ $('#list_' + calendar.uri + ' input.edit').focus();
+ }, 50);
};
this._$scope.checkNew = function(event,name) {
@@ -793,7 +800,7 @@ angular.module('Tasks').controller('ListController', [
})();
return new ListController($scope, $rootScope, $window, $routeParams, ListsModel, TasksBusinessLayer, CollectionsModel, ListsBusinessLayer, $location,
- SearchBusinessLayer, CalendarService, TasksModel);
+ SearchBusinessLayer, CalendarService, TasksModel, $timeout);
}
]);