0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00

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

Fix saving a single tag with multiple words in it, fixes #824
This commit is contained in:
Tom Talbot 2015-02-04 15:48:37 +00:00
commit c38e3e1b6e

View File

@ -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;
}
});
}