diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-15 18:05:43 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-04-15 18:05:43 +0200 |
commit | 4404c7ee187fc5c533d8b918f8197ec2d697dcd4 (patch) | |
tree | ce9e81ca2f6f8c638dd5ee9752e441f94556305e /js | |
parent | 93c1ef4e7c907ed001c6fa901238f2a076d37682 (diff) | |
parent | 5fe41356b5bb3bd1dada821619e71f024e14d4fb (diff) |
Merge pull request #362 from owncloud/company-only-cards
In case there is not fullName we use the company name
Diffstat (limited to 'js')
-rw-r--r-- | js/components/contactList/contactList_controller.js | 5 | ||||
-rw-r--r-- | js/models/contact_model.js | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/js/components/contactList/contactList_controller.js b/js/components/contactList/contactList_controller.js index 4ecd1713..33f4f786 100644 --- a/js/components/contactList/contactList_controller.js +++ b/js/components/contactList/contactList_controller.js @@ -27,7 +27,6 @@ angular.module('contactsApp') } if (ev.event === 'changeSearch') { ctrl.searchTerm = ev.searchTerm; - ctrl.t.emptySearch; ctrl.t.emptySearch = t('contacts', 'No search result for {query}', {query: ctrl.searchTerm} @@ -151,8 +150,8 @@ angular.module('contactsApp') }); // Watch if we have an invalid contact - $scope.$watch('ctrl.contactList[0].fullName()', function(fullName) { - ctrl.invalid = fullName === ''; + $scope.$watch('ctrl.contactList[0].displayName()', function(displayName) { + ctrl.invalid = (displayName === ''); }); ctrl.createContact = function() { diff --git a/js/models/contact_model.js b/js/models/contact_model.js index cc2579fc..6954b590 100644 --- a/js/models/contact_model.js +++ b/js/models/contact_model.js @@ -19,6 +19,10 @@ angular.module('contactsApp') } }, + displayName: function() { + return this.fullName() || this.org() || ''; + }, + fullName: function(value) { var model = this; if (angular.isDefined(value)) { |