diff --git a/static/js/stream_popover.js b/static/js/stream_popover.js index ef745fb5fd..b4e9bf5c4c 100644 --- a/static/js/stream_popover.js +++ b/static/js/stream_popover.js @@ -209,12 +209,8 @@ exports.register_stream_handlers = function () { var sub = stream_popover_sub(e); exports.hide_stream_popover(); - hashchange.go_to_location("#streams"); - // the template for subs needs to render. - - subs.onlaunch("narrow_to_row", function () { - $(".stream-row[data-stream-id='" + sub.stream_id + "']").click(); - }, false); + var stream_edit_hash = hash_util.stream_edit_uri(sub); + hashchange.go_to_location(stream_edit_hash); }); // Narrow to stream diff --git a/static/js/subs.js b/static/js/subs.js index 11c46ba7d0..5babafb080 100644 --- a/static/js/subs.js +++ b/static/js/subs.js @@ -1,8 +1,5 @@ var subs = (function () { -var meta = { - callbacks: {}, -}; var exports = {}; exports.show_subs_pane = { @@ -558,7 +555,6 @@ exports.setup_page = function (callback) { if (callback) { callback(); - exports.onlaunchtrigger(); } } @@ -569,28 +565,6 @@ exports.setup_page = function (callback) { } }; -// add a function to run on subscription page launch by name, -// and specify whether it should be kept or just run once (boolean). -exports.onlaunch = function (name, callback, keep) { - meta.callbacks[name] = { - func: callback, - keep: keep, - }; -}; - -exports.onlaunchtrigger = function () { - for (var x in meta.callbacks) { - if (typeof meta.callbacks[x].func === "function") { - meta.callbacks[x].func(); - - // delete if it should not be kept. - if (!meta.callbacks[x].keep) { - delete meta.callbacks[x]; - } - } - } -}; - exports.switch_to_stream_row = function (stream_id) { var stream_row = row_for_stream_id(stream_id);