Add link to stream settings from sidebar popover

(Trac #1375)

(imported from commit 92fdbc9906f1394f3ae484a91919226224f43631)
This commit is contained in:
Scott Feeney scott@humbughq.com 2013-06-18 16:15:41 -04:00
parent 0119423d27
commit 42d2c40464
3 changed files with 17 additions and 0 deletions

View File

@ -283,6 +283,10 @@ function settings_for_sub(sub) {
return $("#subscription_settings_" + id);
}
exports.show_settings_for = function (stream_name) {
settings_for_sub(get_sub(stream_name)).collapse('show');
};
function add_sub_to_table(sub) {
$('#create_stream_row').after(
templates.render('subscription', {subscriptions: [sub]}));

View File

@ -1533,6 +1533,13 @@ $(function () {
e.stopPropagation();
});
$('body').on('click', '.open_stream_settings', function (e) {
var stream = $(e.currentTarget).parents('ul').attr('data-name');
ui.hide_stream_sidebar_popover();
ui.change_tab_to('#subscriptions');
setTimeout(function () { subs.show_settings_for(stream); }, 100);
});
$("body").on('click', function (e) {
// Dismiss the popover if the user has clicked outside it
if ($('.popover-inner').has(e.target).length === 0) {

View File

@ -23,6 +23,12 @@
Compose a message to stream {{stream.name}}
</a>
</li>
<li>
<a class="open_stream_settings">
<i class="icon-vector-cog"></i>
Stream settings
</a>
</li>
<li>
<span class="colorpicker-container"><input stream_name="{{stream.name}}" class="colorpicker" type="text" value="{{stream.color}}" /></span>
<a class="custom_color">Choose custom color</a>