added dynamic attributes that can be targetted via css (#67)
Dieser Commit ist enthalten in:
Ursprung
505043922e
Commit
e7635b632c
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
|
@ -6,7 +6,8 @@ export default registerUnbound("char-counter", function(body, maxLength) {
|
||||||
let finalString;
|
let finalString;
|
||||||
|
|
||||||
if (maxLength) {
|
if (maxLength) {
|
||||||
finalString = `<div class="body-length">${bodyLength} / ${I18n.t('wizard.x_characters', { count: parseInt(maxLength) })}</div>`;
|
let isOverMax = bodyLength > maxLength ? "true" : "false";
|
||||||
|
finalString = `<div class="body-length" data-length=${bodyLength} data-over-max=${isOverMax}>${bodyLength} / ${I18n.t('wizard.x_characters', { count: parseInt(maxLength) })}</div>`;
|
||||||
} else {
|
} else {
|
||||||
finalString = `<div class="body-length">${I18n.t('wizard.x_characters', { count: parseInt(bodyLength) })}</div>`;
|
finalString = `<div class="body-length">${I18n.t('wizard.x_characters', { count: parseInt(bodyLength) })}</div>`;
|
||||||
}
|
}
|
||||||
|
|
Laden …
In neuem Issue referenzieren