aboutsummaryrefslogtreecommitdiff
path: root/html/text_entry_list.js
diff options
context:
space:
mode:
Diffstat (limited to 'html/text_entry_list.js')
-rw-r--r--html/text_entry_list.js10
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) {