js: Rename viewport.js to message_viewport.js.

This fixes the mobile web experience for Chrome on iOS.

Apparently, Chrome-on-iOS silently has a `viewport` module that
overrides and user-defined module by that name, causing all of our
code that accesses the viewport module to not work on that platform.
We fix this by renaming it.
This commit is contained in:
Tim Abbott
2017-03-10 14:48:51 -08:00
parent b1f12133be
commit 5e39ccd642
21 changed files with 67 additions and 65 deletions

View File

@@ -133,7 +133,7 @@ function update_in_home_view(sub, value) {
var saved_ypos;
// Save our current scroll position
if (ui.home_tab_obscured()) {
saved_ypos = viewport.scrollTop();
saved_ypos = message_viewport.scrollTop();
} else if (home_msg_list === current_msg_list &&
current_msg_list.selected_row().offset() !== null) {
msg_offset = current_msg_list.selected_row().offset().top;
@@ -146,7 +146,7 @@ function update_in_home_view(sub, value) {
// Ensure we're still at the same scroll position
if (ui.home_tab_obscured()) {
viewport.scrollTop(saved_ypos);
message_viewport.scrollTop(saved_ypos);
} else if (home_msg_list === current_msg_list) {
// We pass use_closest to handle the case where the
// currently selected message is being hidden from the
@@ -154,7 +154,7 @@ function update_in_home_view(sub, value) {
home_msg_list.select_id(home_msg_list.selected_id(),
{use_closest: true, empty_ok: true});
if (current_msg_list.selected_id() !== -1) {
viewport.set_message_offset(msg_offset);
message_viewport.set_message_offset(msg_offset);
}
}