subs: Fix stream privacy changes not working after renaming.

This fixes and issue where the change_stream_privacy template had its
own duplicate copy of the data-stream-name attribute, which wasn't
updated when streams were renamed.

Fixes #2016.
This commit is contained in:
Tim Abbott 2016-10-28 16:42:32 -07:00
parent 6927a9bdc4
commit 1bc9be7aed
2 changed files with 3 additions and 3 deletions

View File

@ -1094,8 +1094,8 @@ $(function () {
function change_stream_privacy(e, url, success_message, error_message, invite_only) {
e.preventDefault();
var stream_name = $(e.target).attr("data-stream-name");
var sub_row = $(e.target).closest('.stream-row');
var stream_name = sub_row.attr("data-stream-name");
$("#subscriptions-status").hide();
var data = {"stream_name": stream_name};

View File

@ -1,10 +1,10 @@
{{#if can_make_public}}
<button class="btn btn-primary make-stream-public-button" data-stream-name="{{name}}" tabindex="-1">
<button class="btn btn-primary make-stream-public-button" tabindex="-1">
{{t "Make stream public" }}
</button>
{{/if}}
{{#if can_make_private}}
<button class="btn btn-danger make-stream-private-button" data-stream-name="{{name}}" tabindex="-1">
<button class="btn btn-danger make-stream-private-button" tabindex="-1">
{{t "Make stream private" }}
</button>
{{/if}}