streams: Hide and show settings properly for subscribed streams.

This now will show the settings properly when one unsubscribes and
resubscribes to a particular stream.

Fixes: #6798.
This commit is contained in:
Brock Whittaker 2017-10-02 15:16:36 -07:00 committed by Tim Abbott
parent 9e9927d1d0
commit 59cfed16ed
1 changed files with 4 additions and 13 deletions

View File

@ -38,22 +38,13 @@ function rerender_subscribers_list(sub) {
}
exports.collapse = function (sub) {
// I am not sure whether this code is really correct; it was extracted
// from subs.update_settings_for_unsubscribed() and possibly pre-dates
// our big streams re-design in late 2016.
var stream_settings = settings_for_sub(sub);
if (stream_settings.hasClass('in')) {
stream_settings.collapse('hide');
}
var sub_row = stream_settings.closest('.stream-row');
sub_row.find(".regular_subscription_settings").removeClass('in');
var $settings = $(".subscription_settings[data-stream-id='" + sub.stream_id + "']");
$settings.find(".regular_subscription_settings").removeClass('in');
};
exports.show_sub = function (sub) {
var stream_settings = settings_for_sub(sub);
var sub_row = stream_settings.closest('.stream-row');
sub_row.find(".regular_subscription_settings").addClass('in');
var $settings = $(".subscription_settings[data-stream-id='" + sub.stream_id + "']");
$settings.find(".regular_subscription_settings").addClass('in');
};
exports.add_me_to_member_list = function (sub) {