mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
Extract notifications.reify_message_id().
This removes the last need for a message_id_changed event.
This commit is contained in:
@@ -619,23 +619,24 @@ $(function () {
|
||||
window.bridge = bridge;
|
||||
}
|
||||
|
||||
$(document).on('message_id_changed', function (event) {
|
||||
var old_id = event.old_id;
|
||||
var new_id = event.new_id;
|
||||
|
||||
// If a message ID that we're currently storing (as a link) has changed,
|
||||
// update that link as well
|
||||
_.each($('#out-of-view-notification a'), function (e) {
|
||||
var elem = $(e);
|
||||
var msgid = elem.data('msgid');
|
||||
|
||||
if (msgid === old_id) {
|
||||
elem.data('msgid', new_id);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
exports.reify_message_id = function (opts) {
|
||||
var old_id = opts.old_id;
|
||||
var new_id = opts.new_id;
|
||||
|
||||
// If a message ID that we're currently storing (as a link) has changed,
|
||||
// update that link as well
|
||||
_.each($('#out-of-view-notification a'), function (e) {
|
||||
var elem = $(e);
|
||||
var msgid = elem.data('msgid');
|
||||
|
||||
if (msgid === old_id) {
|
||||
elem.data('msgid', new_id);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
exports.register_click_handlers = function () {
|
||||
$('#out-of-view-notification').on('click', '.compose_notification_narrow_by_subject', function (e) {
|
||||
var msgid = $(e.currentTarget).data('msgid');
|
||||
|
||||
Reference in New Issue
Block a user