Grey out sidebar streams if they're not in the home view.

(imported from commit 4fdd1cb13ba36264803facb59ecf05c40056a59a)
This commit is contained in:
Luke Faraone 2013-05-15 14:36:50 -07:00 committed by Leo Franchi
parent f9b82f2ab8
commit 3f37f88255
3 changed files with 13 additions and 0 deletions

View File

@ -94,6 +94,9 @@ function add_narrow_filter(name, type) {
.html(swatch);
if (type === 'stream') {
list_item.attr('id', "stream_sidebar_" + subs.stream_id(name));
if (subs.have(name).in_home_view === false) {
list_item.addClass("out_of_home_view");
}
}
list_item.append($('<a>').attr('href', uri)

View File

@ -192,6 +192,12 @@ exports.toggle_home = function (stream_name) {
exports.maybe_toggle_all_messages();
set_stream_property(stream_name, 'in_home_view', sub.in_home_view);
var li = $("#stream_filters li[data-name='" + encodeURIComponent(stream_name) + "']");
if (sub.in_home_view) {
li.removeClass("out_of_home_view");
} else {
li.addClass("out_of_home_view");
}
};
function stream_notifications_clicked(e) {

View File

@ -277,6 +277,10 @@ ul.filters li:hover .arrow {
cursor: pointer;
}
ul.filters li.out_of_home_view {
opacity: 0.25;
}
.message_list {
/* If we change this color, we must change message_reply_fade */
background-color: aliceblue;