diff --git a/bower.json b/bower.json index 533ae48ed..11ffa1b4d 100644 --- a/bower.json +++ b/bower.json @@ -26,8 +26,8 @@ "angular-uuid4": "0.3.1", "jquery-timepicker": "883bb2cd94", "ui-select": "angular-ui/ui-select#0.14.9", - "vcard": "Heymdall/vcard#1eb59e9b4406a3253bbb9295a1da776d22cdfe3a", - "ngclipboard": "^1.1.1" + "ngclipboard": "^1.1.1", + "vcard": "0.2.7" }, "devDependencies": { "angular-mocks": "1.5.8", diff --git a/js/components/parsers/groupModel_directive.js b/js/components/parsers/groupModel_directive.js deleted file mode 100644 index 21d14979a..000000000 --- a/js/components/parsers/groupModel_directive.js +++ /dev/null @@ -1,18 +0,0 @@ -angular.module('contactsApp') -.directive('groupModel', function() { - return{ - restrict: 'A', - require: 'ngModel', - link: function(scope, element, attr, ngModel) { - ngModel.$formatters.push(function(value) { - if (value.trim().length === 0) { - return []; - } - return value.split(','); - }); - ngModel.$parsers.push(function(value) { - return value.join(','); - }); - } - }; -}); diff --git a/js/models/contact_model.js b/js/models/contact_model.js index 4103cb3b9..0084b4048 100644 --- a/js/models/contact_model.js +++ b/js/models/contact_model.js @@ -139,11 +139,13 @@ angular.module('contactsApp') } else { // getter var property = this.getProperty('categories'); - if(property && property.value.length > 0) { - return property.value.split(','); - } else { + if(!property) { return []; } + if (angular.isArray(property.value)) { + return property.value; + } + return [property.value]; } }, @@ -293,6 +295,10 @@ angular.module('contactsApp') var property = this.getProperty('categories'); if(!property) { this.categories(''); + } else { + if (angular.isString(property.value)) { + this.categories([property.value]); + } } }; }); diff --git a/templates/detailItems/groups.html b/templates/detailItems/groups.html index 160cc0eb5..ff776ce02 100644 --- a/templates/detailItems/groups.html +++ b/templates/detailItems/groups.html @@ -1,5 +1,5 @@ - {{$item}}