Merge pull request #825 from Tivix/fix-multiword-tags-save

Fix saving a single tag with multiple words in it, fixes #824
pull/964/head
Tom Talbot 2015-02-04 15:48:37 +00:00
commit c38e3e1b6e
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -117,7 +117,15 @@ function initDateTimeChooser(id) {
function initTagField(id, autocompleteUrl) {
$('#' + id).tagit({
autocomplete: {source: autocompleteUrl}
autocomplete: {source: autocompleteUrl},
preprocessTag: function(val) {
// Double quote a tag if it contains a space
// and if it isn't already quoted.
if (val && val[0] != '"' && val.indexOf(' ') > -1) {
return '"' + val + '"';
}
return val;
}
});
}