Merge pull request #224 from OndrejSodek/patch-2

Fix diacritics downcoding in slugs
This commit is contained in:
Alexandre Silva 2018-12-13 17:21:48 +00:00 committed by GitHub
commit d9a8c2c06d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8,13 +8,13 @@ $(document).ready(function () {
$('#id_title_' + lang_code).on('focus', function () {
/* slug should only follow the title field if its value matched the title's value at the time of focus */
var currentSlug = $('#id_slug_' + lang_code).val();
var slugifiedTitle = cleanForSlug(this.value);
var slugifiedTitle = cleanForSlug(this.value, true);
slugFollowsTitle = (currentSlug == slugifiedTitle);
});
$('#id_title_' + lang_code).on('keyup keydown keypress blur', function () {
if (slugFollowsTitle) {
var slugifiedTitle = cleanForSlug(this.value);
var slugifiedTitle = cleanForSlug(this.value, true);
$('#id_slug_' + lang_code).val(slugifiedTitle);
}
});