summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-03-12 15:30:52 +0100
committerThomas Tanghus <thomas@tanghus.net>2012-03-12 15:30:52 +0100
commit2b8125f4babd25f2444bfe5d8281f11b00bfd016 (patch)
treeccf440466ab7d43d4c9b77d037416bfe7cf6df49
parentd36d317bb21774e0629d760294080510a7501206 (diff)
downloadnextcloud-server-2b8125f4babd25f2444bfe5d8281f11b00bfd016.tar.gz
nextcloud-server-2b8125f4babd25f2444bfe5d8281f11b00bfd016.zip
Small fix to jquery.multiple_autocomplete.
-rw-r--r--apps/contacts/js/jquery.multi-autocomplete.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/apps/contacts/js/jquery.multi-autocomplete.js b/apps/contacts/js/jquery.multi-autocomplete.js
index 7cc9df1930d..1c923a2543d 100644
--- a/apps/contacts/js/jquery.multi-autocomplete.js
+++ b/apps/contacts/js/jquery.multi-autocomplete.js
@@ -14,6 +14,12 @@
//console.log('_create: ' + this.options['id']);
var self = this;
this.element.bind('blur', function( event ) {
+ var tmp = self.element.val().trim();
+ if(tmp[tmp.length-1] == ',') {
+ self.element.val(tmp.substring(0, tmp.length-1));
+ } else {
+ self.element.val(tmp);
+ }
self.element.trigger('change'); // Changes wasn't saved when only using the dropdown.
});
this.element.bind( "keydown", function( event ) {
@@ -62,6 +68,10 @@
// work around a bug (likely same cause as #5265)
$( this ).blur();
+ var tmp = self.element.val().trim();
+ if(tmp[tmp.length-1] != ',') {
+ self.element.val(tmp+', ');
+ }
// pass empty string as value to search for, displaying all results
self.element.autocomplete( "search", "" );
self.element.focus();