summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-04-15 11:50:52 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2016-04-15 11:50:52 +0200
commit246dc972c470a62eaaa9ffababbbe39e1bbd9f25 (patch)
tree34fa97f9cd9c7f0a0efa905a73c26995671a98e5 /js
parent5a8b7860e3186127ed3509e837e9a0db23c21a42 (diff)
In case there is not fullName we use the company name - fixes #335
Diffstat (limited to 'js')
-rw-r--r--js/components/contactList/contactList_controller.js5
-rw-r--r--js/models/contact_model.js4
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)) {