For web pages, the initial favicon is the same as the favicon we
set for no unread messages and the initial page title is the same
as the page title we set for no unread messages. However, for the
OS X app, the dock icon does not get its badge updated on initial
page load. If the badge icon was wrong right before a reload and
we actually have no unread messages then we will never execute
bridge.updateCount() until the unread count changes. Therefore,
we now ensure that bridge.updateCount is always run at least once
to synchronize it with the page title.
(imported from commit 5d1269c62c1c3190aea96ef6f96c46acdb9fdf9c)
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)