Skip to content

Commit

Permalink
Merge pull request #112 from obgnail/dev
Browse files Browse the repository at this point in the history
update custom
  • Loading branch information
obgnail authored Aug 23, 2023
2 parents 9413e9f + 02d5a0d commit e7f73cc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugin/custom/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ class modalHelper {
this.utils.insertDiv(modal);
}

hide = () => this.entities.modal.style.display = "none";

process = () => {
this.pluginModal = null;
this.entities = {
Expand All @@ -187,7 +189,7 @@ class modalHelper {
cancel: document.querySelector("#plugin-custom-modal button.plugin-modal-cancel"),
}

this.entities.cancel.addEventListener("click", () => this.entities.modal.style.display = "none")
this.entities.cancel.addEventListener("click", this.hide)

this.entities.submit.addEventListener("click", () => {
const name = this.entities.content.getAttribute("custom-plugin-name");
Expand All @@ -202,7 +204,7 @@ class modalHelper {
}
})
plugin.onEvent("submit", this.pluginModal);
this.entities.modal.style.display = "none";
this.hide();
})

this.entities.modal.addEventListener("keydown", ev => {
Expand Down

0 comments on commit e7f73cc

Please sign in to comment.