diff --git a/UI/Templates/ContactsUI/UIxContactFoldersView.wox b/UI/Templates/ContactsUI/UIxContactFoldersView.wox index 1a94ddaf2..1a88caf9c 100644 --- a/UI/Templates/ContactsUI/UIxContactFoldersView.wox +++ b/UI/Templates/ContactsUI/UIxContactFoldersView.wox @@ -240,14 +240,16 @@ - +
- + diff --git a/UI/WebServerResources/js/Contacts/card-model.js b/UI/WebServerResources/js/Contacts/card-model.js index 3eb28095f..a4bf0ac02 100644 --- a/UI/WebServerResources/js/Contacts/card-model.js +++ b/UI/WebServerResources/js/Contacts/card-model.js @@ -21,6 +21,8 @@ this.isNew = true; } + this.refs = []; + if (!this.shortFormat) this.shortFormat = this.$shortFormat(); diff --git a/UI/WebServerResources/js/ContactsUI.js b/UI/WebServerResources/js/ContactsUI.js index a444bd3e5..320b51197 100644 --- a/UI/WebServerResources/js/ContactsUI.js +++ b/UI/WebServerResources/js/ContactsUI.js @@ -91,7 +91,7 @@ $urlRouterProvider.otherwise('/personal'); }]) - .controller('AddressBookCtrl', ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', 'sgFocus', 'sgCard', 'sgAddressBook', 'sgDialog', 'sgSettings', 'stateAddressbooks', 'stateAddressbook', function($state, $scope, $rootScope, $stateParams, $timeout, $modal, focus, Card, AddressBook, Dialog, Settings, stateAddressbooks, stateAddressbook) { + .controller('AddressBookCtrl', ['$state', '$scope', '$rootScope', '$stateParams', '$timeout', '$mdDialog', 'sgFocus', 'sgCard', 'sgAddressBook', 'sgDialog', 'sgSettings', 'stateAddressbooks', 'stateAddressbook', function($state, $scope, $rootScope, $stateParams, $timeout, $mdDialog, focus, Card, AddressBook, Dialog, Settings, stateAddressbooks, stateAddressbook) { var currentAddressbook; $scope.activeUser = Settings.activeUser; @@ -127,6 +127,41 @@ } }); }; + $scope.newComponent = function(ev) { + $mdDialog.show({ + parent: angular.element(document.body), + targetEvent: ev, + clickOutsideToClose: true, + escapeToClose: true, + template: + '' + + ' ' + + '
' + + ' ' + + ' Contact' + + ' ' + + ' ' + + ' List' + + ' ' + + '
' + + '
' + + '
', + locals: { + state: $state + }, + controller: ComponentDialogController + }); + function ComponentDialogController(scope, $mdDialog, state) { + scope.createContact = function() { + state.go('addressbook.new', { addressbookId: $scope.addressbook.id, contactType: 'card' }); + $mdDialog.hide(); + } + scope.createList = function() { + state.go('addressbook.new', { addressbookId: $scope.addressbook.id, contactType: 'list' }); + $mdDialog.hide(); + } + } + }; $scope.currentFolderIsConfigurable = function(folder) { return ($scope.addressbook && $scope.addressbook.id == folder.id && !folder.isRemote); };