Skip to content
This repository has been archived by the owner on Jul 12, 2023. It is now read-only.

Only update SMS preview when the textarea updates #1840

Merged
merged 1 commit into from
Feb 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cmd/server/assets/realmadmin/_form_sms.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,12 @@
}

// When the textarea changes, rebuild the splits.
const $templates = $('textarea.sms-text-template');
$(document).on('keyup', $templates, function(e) {
$(document).on('keyup', 'textarea.sms-text-template', function(e) {
buildTemplateSplits(e.target);
});

// On initial page load, build the split.
buildTemplateSplits($templates[0]);
buildTemplateSplits($('textarea.sms-text-template')[0]);

//
// SMS templates builder
Expand Down