diff --git a/frontend_tests/node_tests/i18n.js b/frontend_tests/node_tests/i18n.js index 2497ee894b..7cb3cdc907 100644 --- a/frontend_tests/node_tests/i18n.js +++ b/frontend_tests/node_tests/i18n.js @@ -55,7 +55,6 @@ i18n.init({ enable_offline_push_notifications: false, enable_online_push_notifications: false, enable_digest_emails: false, - autoscroll_forever: false, default_desktop_notifications: false, }, }; diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index 85d4fc7e64..1150e71df1 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -958,7 +958,7 @@ function render(template_name, args) { enable_sounds: true, enable_offline_email_notifications: true, enable_offline_push_notifications: true, enable_online_push_notifications: true, enable_digest_emails: true, - autoscroll_forever: true, default_desktop_notifications: true, + default_desktop_notifications: true, }; var page_params = $.extend(page_param_checkbox_options, { full_name: "Alyssa P. Hacker", password_auth_enabled: true, @@ -970,7 +970,7 @@ function render(template_name, args) { "enable_stream_sounds", "enable_desktop_notifications", "enable_sounds", "enable_offline_push_notifications", "enable_online_push_notifications", - "enable_digest_emails", "autoscroll_forever", + "enable_digest_emails", "default_desktop_notifications"]; // Render with all booleans set to true. diff --git a/static/js/message_list_view.js b/static/js/message_list_view.js index c25fbb4da6..1f66937ace 100644 --- a/static/js/message_list_view.js +++ b/static/js/message_list_view.js @@ -475,8 +475,6 @@ MessageListView.prototype = { var list = this.list; // for convenience var table_name = this.table_name; var table = rows.get_table(table_name); - // we we record if last_message_was_selected before updating the table - var last_message_was_selected = rows.id(rows.last_visible()) === list.selected_id(); var orig_scrolltop_offset; var message_containers; @@ -654,13 +652,12 @@ MessageListView.prototype = { } if (list === current_msg_list && messages_are_new) { - self._maybe_autoscroll(new_dom_elements, last_message_was_selected); + self._maybe_autoscroll(new_dom_elements); } }, - _maybe_autoscroll: function MessageListView__maybe_autoscroll(rendered_elems, - last_message_was_selected) { + _maybe_autoscroll: function MessageListView__maybe_autoscroll(rendered_elems) { // If we are near the bottom of our feed (the bottom is visible) and can // scroll up without moving the pointer out of the viewport, do so, by // up to the amount taken up by the new message. @@ -686,14 +683,6 @@ MessageListView.prototype = { } }, this); - // autoscroll_forever: if we're on the last message, keep us on the last message - if (last_message_was_selected && page_params.autoscroll_forever) { - this.list.select_id(this.list.last().id, {from_rendering: true}); - navigate.scroll_to_selected(); - this.list.reselect_selected_id(); - return; - } - var selected_row = this.selected_row(); var last_visible = rows.last_visible(); @@ -706,16 +695,6 @@ MessageListView.prototype = { var info = message_viewport.message_viewport_info(); var available_space_for_scroll = selected_row_offset - info.visible_top; - var rows_offset = rows.last_visible().offset().top - this.list.selected_row().offset().top; - - // autoscroll_forever: if we've sent a message, move pointer at least that far. - if (page_params.autoscroll_forever && id_of_last_message_sent_by_us > -1 && - rows_offset < (message_viewport.height())) { - this.list.select_id(id_of_last_message_sent_by_us, {from_rendering: true}); - navigate.scroll_to_selected(); - return; - } - // Don't scroll if we can't move the pointer up. if (available_space_for_scroll <= 0) { return; diff --git a/static/js/notifications.js b/static/js/notifications.js index 6d1b9a129a..c84af7671d 100644 --- a/static/js/notifications.js +++ b/static/js/notifications.js @@ -495,10 +495,7 @@ exports.received_messages = function (messages) { if (!message_is_notifiable(message)) { return; } - // checking for unread flags here is basically proxy for - // "is Zulip currently in focus". In the case of auto-scroll forever, - // we don't care - if (!unread.message_unread(message) && !page_params.autoscroll_forever) { + if (!unread.message_unread(message)) { return; } diff --git a/static/js/resize.js b/static/js/resize.js index c9557e6dc9..30eb818ef3 100644 --- a/static/js/resize.js +++ b/static/js/resize.js @@ -203,9 +203,7 @@ exports.watch_manual_resize = function (element) { }; exports.resize_bottom_whitespace = function (h) { - if (page_params.autoscroll_forever) { - $("#bottom_whitespace").height($("#compose-container")[0].offsetHeight); - } else if (h !== undefined) { + if (h !== undefined) { $("#bottom_whitespace").height(h.bottom_whitespace_height); } }; diff --git a/static/js/settings_lab.js b/static/js/settings_lab.js index 4a097d7451..3016c0d8d6 100644 --- a/static/js/settings_lab.js +++ b/static/js/settings_lab.js @@ -8,7 +8,7 @@ exports.set_up = function () { $("#ui-settings .change-setting").change(function (e) { e.preventDefault(); var labs_updates = {}; - _.each(["autoscroll_forever", "default_desktop_notifications"], + _.each(["default_desktop_notifications"], function (setting) { labs_updates[setting] = $("#" + setting).is(":checked"); }); @@ -16,16 +16,10 @@ exports.set_up = function () { channel.patch({ url: '/json/settings/ui', data: labs_updates, - success: function (resp, statusText, xhr) { + success: function () { var message = i18n.t("Updated settings! You will need to reload for these changes to take effect.", page_params); - var result = JSON.parse(xhr.responseText); var ui_settings_status = $('#ui-settings-status').expectOne(); - if (result.autoscroll_forever !== undefined) { - page_params.autoscroll_forever = result.autoscroll_forever; - resize.resize_page_components(); - } - ui_report.success(message, ui_settings_status); }, error: function (xhr) { diff --git a/static/templates/settings/ui-settings.handlebars b/static/templates/settings/ui-settings.handlebars index 17ab00d8b4..108ddeb6c2 100644 --- a/static/templates/settings/ui-settings.handlebars +++ b/static/templates/settings/ui-settings.handlebars @@ -6,18 +6,6 @@