summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-02 16:55:12 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-02 16:55:12 +0100
commit4602c73b3d880a909e10729deb90cbfac3b9ce95 (patch)
tree7b49c061e5f592b418511ca5867afee9b1d7be74
parent27e26bee7acb2e374d6de4d27c910bd89b34a069 (diff)
parent538f28d32cea3eee203a8cc010f03e82faea648a (diff)
Merge pull request #87 from owncloud/add-contact-to-selected-group
Add new contact to currently selected group.
-rw-r--r--js/components/contactList/contactList_controller.js20
-rw-r--r--js/public/script.js20
2 files changed, 22 insertions, 18 deletions
diff --git a/js/components/contactList/contactList_controller.js b/js/components/contactList/contactList_controller.js
index 8c7ae99d..b1162429 100644
--- a/js/components/contactList/contactList_controller.js
+++ b/js/components/contactList/contactList_controller.js
@@ -28,12 +28,12 @@ app.controller('contactlistCtrl', ['$scope', '$filter', '$route', '$routeParams'
}
}
}
- else if (ev.event === 'create') {
- $route.updateParams({
- gid: $routeParams.gid,
- uid: ev.uid
- });
- }
+ else if (ev.event === 'create') {
+ $route.updateParams({
+ gid: $routeParams.gid,
+ uid: ev.uid
+ });
+ }
ctrl.contacts = ev.contacts;
});
});
@@ -83,9 +83,11 @@ app.controller('contactlistCtrl', ['$scope', '$filter', '$route', '$routeParams'
});
ctrl.createContact = function() {
- ContactService.create().then(function() {
- $('#details-fullName').focus();
- });
+ ContactService.create().then(function(contact) {
+ if ($routeParams.gid !== t('contacts', 'All contacts'))
+ contact.categories($routeParams.gid);
+ $('#details-fullName').focus();
+ });
};
ctrl.hasContacts = function () {
diff --git a/js/public/script.js b/js/public/script.js
index 0b9195a9..ee950769 100644
--- a/js/public/script.js
+++ b/js/public/script.js
@@ -324,12 +324,12 @@ app.controller('contactlistCtrl', ['$scope', '$filter', '$route', '$routeParams'
}
}
}
- else if (ev.event === 'create') {
- $route.updateParams({
- gid: $routeParams.gid,
- uid: ev.uid
- });
- }
+ else if (ev.event === 'create') {
+ $route.updateParams({
+ gid: $routeParams.gid,
+ uid: ev.uid
+ });
+ }
ctrl.contacts = ev.contacts;
});
});
@@ -379,9 +379,11 @@ app.controller('contactlistCtrl', ['$scope', '$filter', '$route', '$routeParams'
});
ctrl.createContact = function() {
- ContactService.create().then(function() {
- $('#details-fullName').focus();
- });
+ ContactService.create().then(function(contact) {
+ if ($routeParams.gid !== t('contacts', 'All contacts'))
+ contact.categories($routeParams.gid);
+ $('#details-fullName').focus();
+ });
};
ctrl.hasContacts = function () {