mirror of https://github.com/zulip/zulip.git
notifications: Use addEventListener to register handlers.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
cb52f4d7fc
commit
f277eb022c
|
@ -266,6 +266,8 @@ run_test('basic_notifications', () => {
|
|||
last_shown_message_id = this.tag;
|
||||
}
|
||||
|
||||
addEventListener() {}
|
||||
|
||||
close() {
|
||||
last_closed_message_id = this.tag;
|
||||
}
|
||||
|
|
|
@ -385,16 +385,16 @@ function process_notification(notification) {
|
|||
msg_count: msg_count,
|
||||
message_id: message.id,
|
||||
});
|
||||
notification_object.onclick = function () {
|
||||
notification_object.addEventListener("click", () => {
|
||||
notification_object.close();
|
||||
if (message.type !== "test-notification") {
|
||||
narrow.by_topic(message.id, {trigger: 'notification'});
|
||||
}
|
||||
window.focus();
|
||||
};
|
||||
notification_object.onclose = function () {
|
||||
});
|
||||
notification_object.addEventListener("close", () => {
|
||||
notice_memory.delete(key);
|
||||
};
|
||||
});
|
||||
} else {
|
||||
in_browser_notify(message, title, content, raw_operators, opts);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue