diff --git a/source/assets/javascripts/locastyle/_char-counter.js b/source/assets/javascripts/locastyle/_char-counter.js index 9c643f85a..7f5c191f3 100644 --- a/source/assets/javascripts/locastyle/_char-counter.js +++ b/source/assets/javascripts/locastyle/_char-counter.js @@ -9,13 +9,15 @@ locastyle.charCounter = (function() { function countText() { $('[data-ls-module="charCounter"]').each(function(index, field) { + $('.ls-number-counter-' + index).parents('.ls-help-inline').remove(); + var limit = $(field).attr('maxlength'); var html = '
' + limit + ' caracteres restantes
'; var prefixGroup = $(field).closest('.ls-prefix-group'); - $(field).removeAttr('maxlength').data().maxlength = limit; + $(field).data().maxlength = limit; if (prefixGroup.length) { prefixGroup.after(html);