diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-01-22 13:49:40 +0100 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-01-22 13:49:40 +0100 |
commit | 7218849ae2f43aee6b3462a30e07caf5bac3d22b (patch) | |
tree | 3de3b31c07e532edf7373faf4a267f313dc2ed25 /html/text_entry_list.js | |
parent | 046b8a7b3e7259bf451926732e6221076b1d4153 (diff) | |
download | browser-extension-7218849ae2f43aee6b3462a30e07caf5bac3d22b.tar.gz browser-extension-7218849ae2f43aee6b3462a30e07caf5bac3d22b.zip |
add a mapping/resources installation dialog
Diffstat (limited to 'html/text_entry_list.js')
-rw-r--r-- | html/text_entry_list.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/html/text_entry_list.js b/html/text_entry_list.js index ff63c79..8cef08f 100644 --- a/html/text_entry_list.js +++ b/html/text_entry_list.js @@ -162,10 +162,11 @@ function Entry(text, list, entry_idx) { [this.cancel_but, this.make_noneditable], [this.noneditable_view, this.make_editable], ]) - dialog.onevent(list.dialog_ctx, node, "click", cb); + node.addEventListener("click", dialog.when_hidden(list.dialog_ctx, cb)); - dialog.onevent(list.dialog_ctx, this.input, "keypress", - e => (e.key === 'Enter') && enter_hit()); + const enter_cb = e => (e.key === 'Enter') && enter_hit(); + this.input.addEventListener("keypress", + dialog.when_hidden(list.dialog_ctx, enter_cb)); if (entry_idx > 0) { const prev_text = list.shown_texts[entry_idx - 1]; @@ -226,7 +227,8 @@ function TextEntryList(dialog_ctx, destroy_cb, const add_new = () => new Entry(null, this, 0); - dialog.onevent(dialog_ctx, this.new_but, "click", add_new); + this.new_but.addEventListener("click", + dialog.when_hidden(dialog_ctx, add_new)); } async function repo_list(dialog_ctx) { |