We encountered a strange bug in Chrome on OSX where the initial call
to set scrollTop when the browser window loads did not do anything,
until we first scrolled to some other location on the page. This
patch "fixes" that by automatically scrolling somewhere else before
scrolling to the target place on the page.
(imported from commit 96be6a0016e9e5fd78380613c9587f38406604df)
Mark messages as read when with the pointer, but mark all messages
read if the last message is visible.
(imported from commit 4c1a928bd6966111f0f34c5207723656b5f193b9)
In a few cases the $.each was doing something imperatively that was
terser and easier to understand by using a different Underscore method,
so a few of these I rewrote.
Some code was using the fact that jQuery sets `this` in the callback to
be the item; I rewrote those to use an explicit parameter.
Some code was using $(some selector).each(callback). I converted these
to _.each($(some selector), callback).
One function, ui.process_condensing, was written to be a jQuery $.each
callback despite being in a totally different module from code using it.
I noticed this and updated the function's args.
(imported from commit bf5922a35f257c168cc09ec1d077415d6ef19a03)