mirror of
https://github.com/Hopiu/wagtail-modeltranslation.git
synced 2026-05-24 23:03:48 +00:00
Merge pull request #224 from OndrejSodek/patch-2
Fix diacritics downcoding in slugs
This commit is contained in:
commit
d9a8c2c06d
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue