Rename things.

narrowbox -> top_statusbar
narrowcontent -> narrowed_to_bar

floating_indicator -> floating_recipient_bar
fixed_narrowbox -> table.floating_recipient

(imported from commit 7b5bbb17aeff9372275311ab09cd3cbf8262ea13)
This commit is contained in:
Waseem Daher 2012-10-15 15:11:16 -04:00
parent acb75ecf67
commit 4d914df68b
4 changed files with 25 additions and 25 deletions

View File

@ -1,13 +1,13 @@
<div class="row">
<div class="span9" id="narrowbox">
<div class="narrowcontent">
<div class="span9" id="top_statusbar">
<div class="narrowed_to_bar">
<div id="narrowlabel">
<div class="close" onclick="show_all_messages()">&times;</div>
<span id="currently_narrowed_to"></span>
</div>
</div>
<div class="floating_indicator">
<table id="fixed_narrowbox">
<div class="floating_recipient_bar">
<table class="floating_recipient">
<tr style="visibility: collapse;">
<td class="ztable_col1" />
<td class="ztable_col2" />

View File

@ -21,7 +21,7 @@ function do_narrow(description, filter_function) {
$("#zfilt").addClass("focused_table");
$("#show_all_messages").removeAttr("disabled");
$(".narrowcontent").show();
$(".narrowed_to_bar").show();
$("#main_div").addClass("narrowed_view");
$("#currently_narrowed_to").html(description).attr("title", description);
$("#zhome").removeClass("focused_table");
@ -103,7 +103,7 @@ function show_all_messages() {
$("#zfilt").removeClass('focused_table');
$("#zhome").addClass('focused_table');
$(".narrowcontent").hide();
$(".narrowed_to_bar").hide();
$("#main_div").removeClass('narrowed_view');
$("#show_all_messages").attr("disabled", "disabled");
$("#currently_narrowed_to").html("");

View File

@ -76,22 +76,22 @@ function resizehandler(e) {
var sidebar = $("#sidebar");
var sidebar_nav = $(".sidebar-nav");
var composebox = $("#compose");
var narrowbox = $("#narrowbox");
var top_statusbar = $("#top_statusbar");
if (viewport.width() <= 767) {
sidebar.removeClass('nav-stacked');
var space_taken_up_by_navbar = sidebar_nav.outerHeight(true);
$("#nav_whitespace").height(space_taken_up_by_navbar); // .visible-phone only, so doesn't need undoing
narrowbox.css('top', space_taken_up_by_navbar);
top_statusbar.css('top', space_taken_up_by_navbar);
var message_list_width = $("#main_div").outerWidth();
composebox.width(message_list_width);
narrowbox.width(message_list_width);
top_statusbar.width(message_list_width);
sidebar_nav.width(message_list_width);
} else {
sidebar.addClass('nav-stacked');
narrowbox.css('top', 0);
narrowbox.width('');
top_statusbar.css('top', 0);
top_statusbar.width('');
composebox.width('');
sidebar_nav.width('');
}
@ -137,22 +137,22 @@ function replace_narrowbar(desired_label) {
$("#current_label_stream").css('display', 'none');
$("#current_label_huddle").css('display', 'table-row');
}
$(".floating_indicator").css('visibility', 'visible');
$(".floating_recipient_bar").css('visibility', 'visible');
}
function hide_narrowbar() {
$(".floating_indicator").css('visibility', 'hidden');
$(".floating_recipient_bar").css('visibility', 'hidden');
}
function update_fixed_narrowbar() {
var fixed_narrowbar = $("#narrowbox");
var fixed_narrowbar_top = fixed_narrowbar.offset().top;
var fixed_narrowbar_bottom = fixed_narrowbar_top + fixed_narrowbar.height();
function update_floating_recipient_bar() {
var top_statusbar = $("#top_statusbar");
var top_statusbar_top = top_statusbar.offset().top;
var top_statusbar_bottom = top_statusbar_top + top_statusbar.height();
// Find the last message where the top of the recipient
// row is no longer visible
var new_label_candidate = $(".focused_table .recipient_row").filter(function () {
return ($(this).offset().top < fixed_narrowbar_bottom);
return ($(this).offset().top < top_statusbar_bottom);
}).last();
if (new_label_candidate.length === 0) {
// We're at the top of the page and no labels are above us.
@ -167,7 +167,7 @@ function update_fixed_narrowbar() {
// Hide if the bottom of our floating stream/subject label is not
// lower than the bottom of current_label (since that means we're
// covering up a label that already exists).
if (fixed_narrowbar_bottom <=
if (top_statusbar_bottom <=
(current_label.offset().top + current_label.height())) {
hide_narrowbar();
return;
@ -180,7 +180,7 @@ function update_fixed_narrowbar() {
// (The last message currently doesn't have a bookend, which is why this might be 0).
if (current_label_bookend.length > 0) {
var my_bookend = $(current_label_bookend[0]);
if (fixed_narrowbar_bottom >
if (top_statusbar_bottom >
(my_bookend.offset().top - my_bookend.height())) {
hide_narrowbar();
return;
@ -230,7 +230,7 @@ $(function () {
// pointer may still want to move.
move_pointer_at_page_top_and_bottom();
}
print_elapsed_time("update_fixed_narrowbar", update_fixed_narrowbar);
print_elapsed_time("update_floating_recipient_bar", update_floating_recipient_bar);
}
});
$(window).mousewheel(throttled_scrollhandler);

View File

@ -316,7 +316,7 @@ input.send_message {
float: right;
}
#narrowbox {
#top_statusbar {
position: fixed;
/* .message_list max-width + 30px margin */
max-width: 670px;
@ -324,21 +324,21 @@ input.send_message {
top: 0px;
}
.narrowcontent {
.narrowed_to_bar {
display: none;
padding: 5px 10px;
background-color: #DDD;
border: 1px solid black;
}
.floating_indicator {
.floating_recipient_bar {
max-width: 640px;
/* from .message_list */
padding-left: 10px;
padding-right: 20px;
}
#fixed_narrowbox {
table.floating_recipient {
table-layout: fixed;
margin-left: auto;
width: 100%;