Files
zulip/static/js/pm_list_dom.js
Anders Kaseorg d2520cd7e0 js: Replace underscore with lodash and remove it from globals.
Tweaked by tabbott to bump PROVISION_VERSION.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2020-07-26 16:12:06 -07:00

32 lines
639 B
JavaScript

const _ = require("lodash");
const render_pm_list_item = require("../templates/pm_list_item.hbs");
exports.keyed_pm_li = (convo) => {
const render = () => render_pm_list_item(convo);
const eq = (other) => _.isEqual(convo, other.convo);
const key = convo.user_ids_string;
return {
key,
render,
convo,
eq,
};
};
exports.pm_ul = (convos) => {
const attrs = [
["class", "expanded_private_messages"],
["data-name", "private"],
];
return vdom.ul({
attrs,
keyed_nodes: convos.map(exports.keyed_pm_li),
});
};
window.pm_list_dom = exports;