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:
commit
c38e3e1b6e
@ -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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user