From c8eec9b54d872cc9fb8a0fc176564c3ae74ebe51 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 14 Jul 2014 00:36:49 +0400 Subject: [PATCH] Improved contacts modal --- app/js/controllers.js | 4 ++-- app/js/services.js | 4 ++-- app/partials/contacts_modal.html | 22 +++++++++++++++++++--- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/app/js/controllers.js b/app/js/controllers.js index 45eed8a6..9b77639f 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -249,7 +249,7 @@ angular.module('myApp.controllers', []) }; $scope.openGroup = function () { - ContactsSelectService.selectContacts().then(function (userIDs) { + ContactsSelectService.selectContacts({action: 'new_group'}).then(function (userIDs) { if (userIDs.length == 1) { $scope.dialogSelect(AppUsersManager.getUserString(userIDs[0])); @@ -415,7 +415,7 @@ angular.module('myApp.controllers', []) } } }); - + $scope.$on('contact_imported', function () { if (contactsShown) { loadDialogs(); diff --git a/app/js/services.js b/app/js/services.js index fc8a7d04..ae411f7c 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -3619,10 +3619,10 @@ angular.module('myApp.services', []) var scope = $rootScope.$new(); scope.multiSelect = multiSelect; - if (multiSelect) { + angular.extend(scope, options); + if (!scope.action && multiSelect) { scope.action = 'select'; } - angular.extend(scope, options); return $modal.open({ templateUrl: 'partials/contacts_modal.html', diff --git a/app/partials/contacts_modal.html b/app/partials/contacts_modal.html index 16598c24..54232890 100644 --- a/app/partials/contacts_modal.html +++ b/app/partials/contacts_modal.html @@ -5,7 +5,7 @@