mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
Remove "More messages below" indicator
It's been very buggy for a while, has limited usefulness compared with unread counts, and profiling over the weekend indicates that it's very slow. (imported from commit 716fe47f2bbec1bd8a6e4d265ded5c64efe2ad5c)
This commit is contained in:
@@ -83,8 +83,6 @@ function show_box(tabname, focus_area, opts) {
|
||||
viewport.user_initiated_animate_scroll(cover+5);
|
||||
}
|
||||
|
||||
// Disable the notifications bar if it overlaps with the composebox
|
||||
notifications_bar.maybe_disable();
|
||||
}
|
||||
|
||||
function clear_invites() {
|
||||
@@ -105,7 +103,6 @@ function hide_box() {
|
||||
$('#stream-message').hide();
|
||||
$('#private-message').hide();
|
||||
$(".new_message_textarea").css("min-height", "");
|
||||
notifications_bar.enable();
|
||||
compose_fade.clear_compose();
|
||||
$('.message_comp').hide();
|
||||
$("#compose_controls").show();
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
var notifications_bar = (function () {
|
||||
|
||||
var exports = {};
|
||||
|
||||
var disabled = false; // true when the bar should be hidden (eg, it's blocking the composebox)
|
||||
var displayed = false; // true when the bar is supposedly displayed (ignoring disabled-ness)
|
||||
var bar_selector = "#notifications-bar"; // the selector jQuery can use to pick the notifications bar
|
||||
var area_selector = "#notifications-area"; // the selector jQuery can use to pick the container
|
||||
|
||||
function show() {
|
||||
if (disabled) {
|
||||
return; // we should never show the bar when disabled
|
||||
}
|
||||
|
||||
if (!displayed) {
|
||||
// If the bar wasn't already displayed, simply show it
|
||||
$(bar_selector).text("More messages below").slideDown(50);
|
||||
displayed = true; // we need to set this flag
|
||||
}
|
||||
}
|
||||
|
||||
// Hide the notifications bar
|
||||
function hide() {
|
||||
if (!displayed) {
|
||||
return; // don't unnecessarily add to the element's fx queue
|
||||
}
|
||||
displayed = false;
|
||||
$(bar_selector).slideUp(50);
|
||||
}
|
||||
|
||||
// If there's a custom message, or if the last message is off the bottom of the
|
||||
// screen, then show the notifications bar.
|
||||
exports.update = function (num_unread) {
|
||||
if (!viewport.bottom_message_visible() && num_unread > 0) {
|
||||
show();
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
// We disable the notifications bar if it overlaps with the composebox
|
||||
exports.maybe_disable = function () {
|
||||
if ($("#compose").offset().left + $("#compose").width() > $(area_selector).offset().left) {
|
||||
disabled = true;
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
// Un-disable the notifications bar, then call the update function to see if it should be displayed
|
||||
exports.enable = function () {
|
||||
disabled = false;
|
||||
exports.update();
|
||||
};
|
||||
|
||||
return exports;
|
||||
}());
|
||||
@@ -249,15 +249,6 @@ exports.handler = function (e) {
|
||||
if (current_msg_list.selected_id() !== -1) {
|
||||
scroll_to_selected();
|
||||
}
|
||||
|
||||
// When the screen resizes, it can make it so that messages are
|
||||
// now on the page, so we need to update the notifications bar.
|
||||
// We may want to do more here in terms of updating unread counts,
|
||||
// but it's possible that resize events can happen as part of
|
||||
// screen resolution changes, so we might want to wait for a more
|
||||
// intentional action to say that the user has "read" a message.
|
||||
var res = unread.get_counts();
|
||||
notifications_bar.update(res.home_unread_messages);
|
||||
};
|
||||
|
||||
return exports;
|
||||
|
||||
@@ -186,7 +186,6 @@ exports.update_unread_counts = function () {
|
||||
stream_list.update_dom_with_unread_counts(res);
|
||||
notifications.update_title_count(res.home_unread_messages);
|
||||
notifications.update_pm_count(res.private_message_count);
|
||||
notifications_bar.update(res.home_unread_messages);
|
||||
};
|
||||
|
||||
exports.enable = function enable() {
|
||||
|
||||
@@ -2764,25 +2764,6 @@ button.topic_edit_cancel {
|
||||
padding-top: 4px;
|
||||
}
|
||||
|
||||
#notifications-bar {
|
||||
z-index: 9000;
|
||||
position: absolute;
|
||||
bottom: 0px; /* necessary to get slideUp, slideDown directions correct */
|
||||
width: 100%;
|
||||
height: 35px;
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
padding: 10px 0px 0px 10px;
|
||||
background: #58F;
|
||||
color: white;
|
||||
font-size: 125%;
|
||||
cursor: default;
|
||||
display: none;
|
||||
/* For now, cut off long messages (but we should find a better solution) */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.empty_feed_notice {
|
||||
padding: 3em 4em;
|
||||
display: none;
|
||||
|
||||
@@ -60,5 +60,4 @@
|
||||
|
||||
{% include "zerver/compose.html" %}
|
||||
<div id="notifications-area">
|
||||
<div id="notifications-bar"></div>
|
||||
</div>
|
||||
|
||||
@@ -22,7 +22,7 @@ var globals =
|
||||
+ ' csrf_token'
|
||||
|
||||
// Modules, defined in their respective files.
|
||||
+ ' compose compose_fade rows hotkeys narrow reload notifications_bar search subs'
|
||||
+ ' compose compose_fade rows hotkeys narrow reload search subs'
|
||||
+ ' composebox_typeahead server_events typeahead_helper notifications hashchange'
|
||||
+ ' invite ui util activity timerender MessageList MessageListView blueslip unread stream_list'
|
||||
+ ' message_edit tab_bar emoji popovers navigate people settings alert_words_ui message_store'
|
||||
|
||||
@@ -533,7 +533,6 @@ JS_SPECS = {
|
||||
'js/filter.js',
|
||||
'js/narrow.js',
|
||||
'js/reload.js',
|
||||
'js/notifications_bar.js',
|
||||
'js/compose_fade.js',
|
||||
'js/fenced_code.js',
|
||||
'js/echo.js',
|
||||
|
||||
Reference in New Issue
Block a user