reactions: Simplify markup related to message ids.

Because of local echo, message ids can change in message rows.
Having reactions use markup to indicate their message id just
creates more moving parts, since we would need to handle
message_id_changed events.

Now our handlers just call row.get_message_id() as needed.
This commit is contained in:
Steve Howell
2017-07-19 08:01:06 -04:00
committed by Tim Abbott
parent 9a239f682d
commit bd59b91faa
6 changed files with 6 additions and 37 deletions

View File

@@ -330,15 +330,6 @@ exports.get_message_reactions = function (message) {
return reactions;
};
exports.initialize = function () {
$(document).on('message_id_changed', function (event) {
// When a message ID is changed via editing, update any
// data-message-id references to it.
var elts = $(".message_reactions[data-message-id='" + event.old_id + "']");
elts.attr("data-message-id", event.new_id);
});
};
return exports;
}());