Add topic_list.active_stream_id().

This commit is contained in:
Steve Howell 2017-08-10 18:29:35 -04:00 committed by Tim Abbott
parent 089670ac1c
commit f706efe12e
2 changed files with 12 additions and 0 deletions

View File

@ -74,6 +74,8 @@ zrequire('topic_list');
attached_to_parent = true;
};
assert.equal(topic_list.active_stream_id(), undefined);
var widget = topic_list.build_widget(parent_elem, stream_id, active_topic, max_topics);
assert(widget.is_for_stream(stream_id));
@ -83,4 +85,6 @@ zrequire('topic_list');
assert(rendered);
assert(item_appended);
assert(attached_to_parent);
assert.equal(topic_list.active_stream_id(), stream_id);
}());

View File

@ -155,6 +155,14 @@ exports.build_widget = function (parent_elem, my_stream_id, active_topic, max_to
return self;
};
exports.active_stream_id = function () {
if (!active_widget) {
return;
}
return active_widget.get_stream_id();
};
exports.rebuild = function (stream_li, stream_id) {
var max_topics = 5;