reset questionbox character counts after successful submit
This commit is contained in:
parent
15d05f1699
commit
bef1c23a66
|
@ -22,6 +22,10 @@ export function questionboxAllHandler(event: Event): void {
|
|||
if (data.success) {
|
||||
document.querySelector<HTMLInputElement>('textarea[name=qb-all-question]').value = '';
|
||||
window['$']('#modal-ask-followers').modal('hide');
|
||||
|
||||
// FIXME: also solve this using a Stimulus controller
|
||||
const characterCount = document.querySelector<HTMLElement>('#modal-ask-followers [data-character-count-max-value]').dataset.characterCountMaxValue;
|
||||
document.querySelector<HTMLElement>('#modal-ask-followers [data-character-count-target="counter"]').innerHTML = characterCount;
|
||||
}
|
||||
|
||||
showNotification(data.message, data.success);
|
||||
|
|
|
@ -29,6 +29,10 @@ export function questionboxUserHandler(event: Event): void {
|
|||
if (data.success) {
|
||||
document.querySelector<HTMLInputElement>('textarea[name=qb-question]').value = '';
|
||||
|
||||
// FIXME: also solve this using a Stimulus controller
|
||||
const characterCount = document.querySelector<HTMLElement>('#question-box[data-character-count-max-value]').dataset.characterCountMaxValue;
|
||||
document.querySelector<HTMLElement>('#question-box [data-character-count-target="counter"]').innerHTML = characterCount;
|
||||
|
||||
if (promote) {
|
||||
const questionbox = document.querySelector('#question-box');
|
||||
questionbox.classList.toggle('d-none');
|
||||
|
|
Loading…
Reference in New Issue