The tag separator now manages , differently

This commit is contained in:
echarp 2018-03-18 18:56:46 +01:00
parent c37fc6f3cd
commit 9fbf119d08
4 changed files with 15 additions and 4 deletions

View File

@ -32,6 +32,10 @@ $(document).on 'turbolinks:load', ->
$(this).css visibility: 'hidden' $(this).css visibility: 'hidden'
$('.field.tags input').tagsInput $('.field.tags input').tagsInput
delimiter: [' ', ','] delimiter: ' '
defaultText: '' defaultText: ''
autocomplete_url: '/tags.json' autocomplete_url: '/tags.json'
onChange: ->
value = $(this).val()
if value.indexOf(',') >= 0
$(this).val(value.replace /,/, '')

View File

@ -62312,9 +62312,16 @@ exports.MarkerCluster = MarkerCluster;
}); });
} }
return $('.field.tags input').tagsInput({ return $('.field.tags input').tagsInput({
delimiter: [' ', ','], delimiter: ' ',
defaultText: '', defaultText: '',
autocomplete_url: '/tags.json' autocomplete_url: '/tags.json',
onChange: function() {
var value;
value = $(this).val();
if (value.indexOf(',') >= 0) {
return $(this).val(value.replace(/,/, ''));
}
}
}); });
}); });