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

Commit

Permalink
Only update SMS preview when the textarea updates (#1840)
Browse files Browse the repository at this point in the history
Apparently `.on` expects a string selector.
  • Loading branch information
sethvargo authored Feb 17, 2021
1 parent b1f7a68 commit 588bc03
Showing 1 changed file with 2 additions and 3 deletions.
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

0 comments on commit 588bc03

Please sign in to comment.