function withMaybeScroll(thunk) {
var stream_metabox = document.getElementById("stream-metabox");
var should_scroll = false;
- if(stream_metabox.scrollTop === (stream_metabox.scrollHeight
- - stream_metabox.offsetHeight)) {
+ // if within a reasonable threshold, we scroll
+ if((stream_metabox.scrollHeight - stream_metabox.offsetHeight)
+ - stream_metabox.scrollTop <= 50) {
should_scroll = true;
}
thunk();