From a93bedc8e63a168917cb5d978c072c53ec75dc4b Mon Sep 17 00:00:00 2001 From: Brock Whittaker Date: Wed, 11 Oct 2017 14:00:36 -0700 Subject: [PATCH] streams: Re-highlight row after re-subscribing. When re-subscribing by way of the "Subscribe" button in the right side settings panel, the row will now be marked as active to highlight that the row is still selected and being looked at. Fixes: #6955. --- static/js/subs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/static/js/subs.js b/static/js/subs.js index 35b354b0d0..2af8b7bb36 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -250,6 +250,12 @@ exports.stream_description_match_stream_ids = []; // query is now an object rather than a string. // Query { input: String, subscribed_only: Boolean } exports.filter_table = function (query) { + var selected_row = window.location.hash.split(/\//)[1]; + + if (parseFloat(selected_row)) { + $(".stream-row[data-stream-id='" + selected_row + "']").addClass("active"); + } + exports.stream_name_match_stream_ids = []; exports.stream_description_match_stream_ids = []; var others = []; @@ -366,6 +372,7 @@ exports.setup_page = function (callback) { subscriptions: sub_rows, hide_all_streams: !should_list_all_streams(), }; + var rendered = templates.render('subscription_table_body', template_data); $('#subscriptions_table').append(rendered); initialize_components();