mirror of https://github.com/zulip/zulip.git
js: Read zid with rows.id.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
8892f463a8
commit
2834b051d2
|
@ -1,3 +1,4 @@
|
|||
zrequire('rows');
|
||||
zrequire('lightbox');
|
||||
|
||||
set_global('blueslip', global.make_zblueslip());
|
||||
|
|
|
@ -134,10 +134,10 @@ exports.open = function (image, options) {
|
|||
sender_full_name = people.my_full_name();
|
||||
} else {
|
||||
const $message = $parent.closest("[zid]");
|
||||
const zid = parseInt($message.attr("zid"), 10);
|
||||
const zid = rows.id($message);
|
||||
const message = message_store.get(zid);
|
||||
if (message === undefined) {
|
||||
blueslip.error("Lightbox for unknown message " + $message.attr("zid"));
|
||||
blueslip.error("Lightbox for unknown message " + rows.id($message));
|
||||
} else {
|
||||
sender_full_name = message.sender_full_name;
|
||||
}
|
||||
|
|
|
@ -500,7 +500,7 @@ MessageListView.prototype = {
|
|||
_put_row: function (row) {
|
||||
// row is a jQuery object wrapping one message row
|
||||
if (row.hasClass('message_row')) {
|
||||
this._rows[row.attr('zid')] = row;
|
||||
this._rows[rows.id(row)] = row;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ function message_unhover() {
|
|||
}
|
||||
|
||||
function message_hover(message_row) {
|
||||
const id = parseInt(message_row.attr("zid"), 10);
|
||||
if (current_message_hover && message_row && current_message_hover.attr("zid") === message_row.attr("zid")) {
|
||||
const id = rows.id(message_row);
|
||||
if (current_message_hover && rows.id(current_message_hover) === id) {
|
||||
return;
|
||||
}
|
||||
// Don't allow on-hover editing for local-only messages
|
||||
|
|
Loading…
Reference in New Issue