This seems to have been somehow introduced in the refactoring to move
the popovers into their own file
(36ad3c61e4d7eb05751f9b886d15edceab656d71).
(imported from commit f5f58844a9c2da4b4433489be1772263f3aba350)
I feel bad about this commit because it really only exists
to fix a math error elsewhere -- it's basically a hacky solution
to Trac #1426 that doesn't involve actually fixing the math
that exists in the app somewhere, but instead makes our app
conform to that math.
(imported from commit ad43bf9440b80fd768c5fa1cbe5cb4a683415c02)
This fix also cleans up the search operators so that @-mentions
and Private messages have a more similar naming convention.
(imported from commit fb1a2119aab5aa9e179c6e321a8d2ef2e90290cf)
This scrolling behavior is driving me crazy on staging.
Reverting until we come up with a better alternative.
This reverts commit 41954fecd9efb43820ed1ccb5210283c17752f51.
(imported from commit 2db602cf51ca734b00ec1bd454c39204468fa024)
This is one case I forgot from the last commit. For example, if the
message actions popover is open, and you open the user sidebar popover,
the message actions popover should close. It now does.
(imported from commit a241634cb1aabf8883cf95ebd5b8ba96f5ed9908)
A cleaner, more general solution would be nice but this fixes at least
the most obvious cases for now.
(imported from commit fc7260e25a4f2172eee74af9c2d9384898947ad3)
This was mistakenly included from a previous iteration of the do_deactivate()
function's interface.
(imported from commit 0a6ddc5ba1dfe944f2cc0087c590046da6a73531)
Previously the viewport.scrollTop() command that we ran in this case
would actually scroll far off the bottom of the site; it only did
something that looked reasonable because bottom_whitespace was small
and thus the scroll was truncated.
This version scrolls to 10% of the viewport away from the top. We may
need to tweak that to instead be a fixed number of pixels or something.
(imported from commit 0176bf6e3662dfa24887f41b110b429bd8054cb0)
Previously the code to save/restore the scroll position when toggling
a stream in/out of the home view would only work if you were currently
not in the home tab -- because you used to only be able to do this
from other pages.
(imported from commit 4002a3980dfd87dabd570abee3ebc63417a78cc5)
Previously, we had some ugly complicated logic through which we
attempted to keep the selected message on screen when prepending
messages, but we didn't actually preserve the scroll position -- the
selected message would jump on the screen. This fixes that, by just
saving/restoring the scroll position of the selected message.
This perhaps makes our model/view split even less clear, but at least
it's correct.
(imported from commit 0a01450bbbcdf1b45c891d0570c9fcfb11769315)
message_list.prepend() now actually only rerenders the new messages
when prepending using the where="top" functionality (previously it
would erroneously just adjust the message database and then wait for
message_list.append() to call _maybe_rerender(), determine that things
are awry, and rerender the whole message list).
(imported from commit c64b7b540a4f5332ad792de0fad9f20750e6db1c)
This has two benefits:
(1) Users can scroll their last message to near the top of the screen,
which decreases how often one needs to scroll down to track current
messages.
(2) It makes scrolling bugs near the bottom of the screen a lot easier
to find, because scrolling down too far isn't blocked by being unable
to scroll messages off the screen.
We should probably later convert this to some formula that varies
dynamically based on the height of the last message.
(imported from commit 41954fecd9efb43820ed1ccb5210283c17752f51)
It turns out that this code tries to place the initial pointer 1/7
from the top; the only reason something reasonable happened
historically is that bottom_whitespace was only 40% of the screen, so
the pointer message ends up landing in the center anyway.
(imported from commit 56d4c2acd018d9a87551c82a43c214c6d80bfb90)
Previously we incorrectly would sometimes trigger autoscroll when
messages arrived via get_old_messages (i.e. we loaded some historical
messages from the server). This resulted in some confusing and
erroneous scrolling behavior.
I kinda hate the fact that we need to pass these values all the way
through the rendering process, but fundamentally there's no other way
for _render to find out, and pushing the autoscrolling higher up in
the stack is hard since we don't return anything like the block of new
messages.
(imported from commit c5ed27f1b21691a21c68ed7e09cff8e3e4a75e76)
This is purely cosmetic, and just puts some similar functions
together in a way that JS lint won't complain about calling a
function before it was defined.
(imported from commit 8a5a81ae5b7ca7dbaa60147ae4f32f50b1cbbf3a)