mirror of
https://github.com/zulip/zulip.git
synced 2025-10-26 17:43:58 +00:00
Add frontend stream description event handling
Update the stream page when receiving stream description change events. (imported from commit 84f6f3846a3197f14a24611cdc06350fae90f9dd)
This commit is contained in:
@@ -151,6 +151,14 @@ function update_stream_name(sub, new_name) {
|
||||
});
|
||||
}
|
||||
|
||||
function update_stream_description(sub, description) {
|
||||
sub.description = description;
|
||||
|
||||
var sub_settings_selector = '.subscription_row[data-subscription-id=' + sub.id + ']';
|
||||
$(sub_settings_selector + ' .subscription_description').text(description);
|
||||
$(sub_settings_selector + ' input.description').val(description);
|
||||
}
|
||||
|
||||
function stream_notifications_clicked(e) {
|
||||
var sub_row = $(e.target).closest('.subscription_row');
|
||||
var stream = sub_row.find('.subscription_name').text();
|
||||
@@ -468,6 +476,9 @@ exports.update_subscription_properties = function (stream_name, property, value)
|
||||
case 'name':
|
||||
update_stream_name(sub, value);
|
||||
break;
|
||||
case 'description':
|
||||
update_stream_description(sub, value);
|
||||
break;
|
||||
default:
|
||||
blueslip.warn("Unexpected subscription property type", {property: property,
|
||||
value: value});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{! Client-side Mustache template for rendering subscriptions.}}
|
||||
{{#with this}}
|
||||
<div class="subscription_row" id="subscription_{{id}}">
|
||||
<div class="subscription_row" id="subscription_{{id}}" data-subscription-id="{{id}}">
|
||||
<div class="subscription_table_elem subscription_header collapsed" data-toggle="collapse" data-target="#subscription_settings_{{id}}">
|
||||
<span class="subscription-setting-icon">
|
||||
{{partial "subscription_setting_icon"}}
|
||||
|
||||
Reference in New Issue
Block a user