Skip to content
Snippets Groups Projects
Commit 88f5b759 authored by Wouter Wolters's avatar Wouter Wolters Committed by Benni Mack
Browse files

[BUGFIX] Fix not showing remaining characters count in IRRE element

When opening a record that has a closed IRRE element, the remaining
characters count is not initialized at all. Reinitialize this correctly
now by filtering out the already processed counters.

Resolves: #80470
Releases: master
Change-Id: I1f0f675ea968e1959f610fbfbdf236d843c1fd11
Reviewed-on: https://review.typo3.org/52226


Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Tested-by: default avatarFrank Naegler <frank.naegler@typo3.org>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
parent 07b4aa1b
Branches
Tags
No related merge requests found
......@@ -590,7 +590,6 @@ define(['jquery',
*/
FormEngine.initializeEvents = function() {
FormEngine.initializeRemainingCharacterViews();
FormEngine.initializeSelectCheckboxes();
$(document).on('click', '.t3js-btn-moveoption-top, .t3js-btn-moveoption-up, .t3js-btn-moveoption-down, .t3js-btn-moveoption-bottom, .t3js-btn-removeoption', function(evt) {
......@@ -744,7 +743,7 @@ define(['jquery',
*/
FormEngine.initializeRemainingCharacterViews = function() {
// all fields with a "maxlength" attribute
var $maxlengthElements = $('[maxlength]').not('.t3js-datetimepicker');
var $maxlengthElements = $('[maxlength]').not('.t3js-datetimepicker').not('.t3js-charcounter-initialized');
$maxlengthElements.on('focus', function(e) {
var $field = $(this),
$parent = $field.parents('.t3js-formengine-field-item:first'),
......@@ -766,6 +765,7 @@ define(['jquery',
// change class and value
$parent.find('.t3js-charcounter span').removeClass().addClass(maxlengthProperties.labelClass).text(TYPO3.lang['FormEngine.remainingCharacters'].replace('{0}', maxlengthProperties.remainingCharacters))
});
$maxlengthElements.addClass('t3js-charcounter-initialized');
$(':password').on('focus', function() {
$(this).attr('type', 'text').select();
}).on('blur', function() {
......@@ -992,6 +992,7 @@ define(['jquery',
FormEngine.initializeNullWithPlaceholderCheckboxes();
FormEngine.initializeInputLinkToggle();
FormEngine.initializeLocalizationStateSelector();
FormEngine.initializeRemainingCharacterViews();
};
/**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment