web: chats / chat: one redraw-keeping-focus helper and one read-coalescing helper (three and four copies)
tsk-xw928bzzhctg Proposed
Audit round 6 (tsk-hgnbapyw7hnh), read at 046a4d3b. View: chats list, chat. Kind: duplication.
What is wrong
- "Remember the focused href,
keepImages,clearand append, refocus" is copied atchat.js:211-231,chats.js:69-95(drawCross, new) andchats.js:96-128. - "One read at a time, run once more after it" is copied at
chat.js:252-262,chats.js:186-195,chats.js:261-271andplacements.js:317.
Proposal
M.dom.redrawList(ul, fresh, selector)and a small coalescing helper indom.js.
Effort / risk: S. Low.