Skip to content

Commit

Permalink
Merge pull request #1309 from plone/petschki-async-textareamimetypese…
Browse files Browse the repository at this point in the history
…lector
  • Loading branch information
petschki authored Apr 21, 2023
2 parents c957bdb + c6d359c commit cc3f4b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pat/textareamimetypeselector/textareamimetypeselector.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ export default Base.extend({
"text/html": { pattern: "tinymce", patternOptions: {} },
},
},
init() {
this.el.addEventListener("input", (e) => this.init_textareas(e.target.value));
this.init_textareas(this.el.value);

async init() {
this.el.addEventListener("input", async (e) => await this.init_textareas(e.target.value));
await this.init_textareas(this.el.value);
},
init_textareas(mimetype) {

async init_textareas(mimetype) {
const pattern_config = this.options.widgets[mimetype];

// there might be more than one textareas with the same name
Expand Down

0 comments on commit cc3f4b6

Please sign in to comment.