subs: Combine another set of settings show handlers.

This commit is contained in:
Tim Abbott 2016-10-27 22:24:40 -07:00
parent 426f2b0405
commit 01f0be27a7
1 changed files with 4 additions and 8 deletions

View File

@ -279,6 +279,10 @@ function prepend_subscriber(sub_row, email) {
} }
function show_subscription_settings(sub_row) { function show_subscription_settings(sub_row) {
var sub_arrow = sub_row.find('.sub_arrow i');
sub_arrow.removeClass('icon-vector-chevron-down');
sub_arrow.addClass('icon-vector-chevron-up');
var stream = sub_row.find('.subscription_name').text(); var stream = sub_row.find('.subscription_name').text();
var warning_elem = sub_row.find('.subscriber_list_container .alert-warning'); var warning_elem = sub_row.find('.subscriber_list_container .alert-warning');
var error_elem = sub_row.find('.subscriber_list_container .alert-error'); var error_elem = sub_row.find('.subscriber_list_container .alert-error');
@ -1155,14 +1159,6 @@ $(function () {
show_subscription_settings(sub_row); show_subscription_settings(sub_row);
}); });
// Change the down arrow to an up arrow on expansion, and back to a down
// arrow on collapse.
// FIXME: If there's a way, it may be better to do this in pure CSS.
$("#subscriptions_table").on("show", ".subscription_settings", function (e) {
var sub_arrow = $(e.target).closest('.subscription_row').find('.sub_arrow i');
sub_arrow.removeClass('icon-vector-chevron-down');
sub_arrow.addClass('icon-vector-chevron-up');
});
$("#subscriptions_table").on("hide", ".subscription_settings", function (e) { $("#subscriptions_table").on("hide", ".subscription_settings", function (e) {
var sub_arrow = $(e.target).closest('.subscription_row').find('.sub_arrow i'); var sub_arrow = $(e.target).closest('.subscription_row').find('.sub_arrow i');
sub_arrow.removeClass('icon-vector-chevron-up'); sub_arrow.removeClass('icon-vector-chevron-up');