Improved contacts modal
This commit is contained in:
parent
45823dd045
commit
c8eec9b54d
@ -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();
|
||||
|
@ -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',
|
||||
|
@ -5,7 +5,7 @@
|
||||
<div class="modal-body">
|
||||
|
||||
<div class="contacts_modal_header">
|
||||
<div class="contacts_modal_edit_wrap" ng-if="action != 'select'" ng-switch="action">
|
||||
<div class="contacts_modal_edit_wrap" ng-if="!action || action == 'edit'" ng-switch="action">
|
||||
<a ng-switch-when="edit" class="contacts_modal_edit_link" ng-click="toggleEdit(false)">
|
||||
Cancel
|
||||
</a>
|
||||
@ -13,7 +13,16 @@
|
||||
Edit
|
||||
</a>
|
||||
</div>
|
||||
<h4 class="contacts_modal_title">Contacts</h4>
|
||||
<h4 class="contacts_modal_title" ng-switch="action">
|
||||
<div ng-switch-when="new_group" ng-switch="selectedCount > 0">
|
||||
<span ng-switch-when="true">
|
||||
<ng-pluralize count="selectedCount" when="{'one': '1 participant', 'other': '{} participants'}">
|
||||
</ng-pluralize>
|
||||
</span>
|
||||
<span ng-switch-default>New Group</span>
|
||||
</div>
|
||||
<span ng-switch-default>Contacts</span>
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
|
||||
@ -60,8 +69,15 @@
|
||||
</div>
|
||||
|
||||
<div class="modal-footer contacts_modal_panel" ng-switch="action">
|
||||
<div ng-switch-when="new_group" class="pull-right">
|
||||
<button class="btn btn-link" ng-click="$dismiss()">Cancel</button>
|
||||
<button class="btn btn-primary" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" ng-click="submitSelected()" type="submit">
|
||||
Next
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button ng-switch-when="select" class="btn btn-primary" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" ng-click="submitSelected()" type="submit">
|
||||
Next »
|
||||
Next
|
||||
</button>
|
||||
<button ng-switch-when="edit" class="btn btn-danger" ng-class="{disabled: !selectedCount}" ng-disabled="!selectedCount" ng-click="deleteSelected()">
|
||||
Delete <strong ng-bind="selectedCount"></strong>
|
||||
|
Loading…
Reference in New Issue
Block a user