mirror of
https://github.com/zulip/zulip.git
synced 2026-06-24 21:08:25 +08:00
Add topic_list.active_stream_id().
This commit is contained in:
parent
089670ac1c
commit
f706efe12e
@ -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);
|
||||
}());
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user