mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 00:46:03 +00:00
subs: Remove unnecessary data-is-private variable.
This commit is contained in:
@@ -632,14 +632,13 @@ function change_stream_privacy(e) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
var stream_id = $(e.target).data("stream-id");
|
var stream_id = $(e.target).data("stream-id");
|
||||||
var is_private = $(e.target).data("is-private");
|
|
||||||
var sub = stream_data.get_sub_by_id(stream_id);
|
var sub = stream_data.get_sub_by_id(stream_id);
|
||||||
|
|
||||||
$("#subscriptions-status").hide();
|
$("#subscriptions-status").hide();
|
||||||
var data = {
|
var data = {
|
||||||
stream_name: sub.name,
|
stream_name: sub.name,
|
||||||
// toggle the privacy setting
|
// toggle the privacy setting
|
||||||
is_private: !is_private,
|
is_private: !sub.invite_only,
|
||||||
};
|
};
|
||||||
|
|
||||||
channel.patch({
|
channel.patch({
|
||||||
@@ -647,12 +646,10 @@ function change_stream_privacy(e) {
|
|||||||
data: data,
|
data: data,
|
||||||
success: function () {
|
success: function () {
|
||||||
sub = stream_data.get_sub_by_id(stream_id);
|
sub = stream_data.get_sub_by_id(stream_id);
|
||||||
var stream_settings = settings_for_sub(sub);
|
|
||||||
var sub_row = $(".stream-row[data-stream-id='" + stream_id + "']");
|
var sub_row = $(".stream-row[data-stream-id='" + stream_id + "']");
|
||||||
|
|
||||||
// save new privacy settings.
|
// save new privacy settings.
|
||||||
stream_settings.find(".change-stream-privacy").expectOne().data("is-private", !is_private);
|
sub.invite_only = !sub.invite_only;
|
||||||
sub.invite_only = !is_private;
|
|
||||||
|
|
||||||
redraw_privacy_related_stuff(sub_row, sub);
|
redraw_privacy_related_stuff(sub_row, sub);
|
||||||
$("#stream_privacy_modal").remove();
|
$("#stream_privacy_modal").remove();
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-default close-privacy-modal" aria-hidden="true">{{t "Cancel" }}</button>
|
<button class="btn btn-default close-privacy-modal" aria-hidden="true">{{t "Cancel" }}</button>
|
||||||
<button class="btn{{#if is_private}} btn-primary{{else}} btn-danger{{/if}}" id="change-stream-privacy-button"
|
<button class="btn{{#if is_private}} btn-primary{{else}} btn-danger{{/if}}" id="change-stream-privacy-button"
|
||||||
tabindex="-1" data-stream-id="{{stream_id}}" data-is-private="{{is_private}}">
|
tabindex="-1" data-stream-id="{{stream_id}}">
|
||||||
{{#if is_private}}
|
{{#if is_private}}
|
||||||
{{t "Make Stream Public"}}
|
{{t "Make Stream Public"}}
|
||||||
{{else}}
|
{{else}}
|
||||||
|
|||||||
Reference in New Issue
Block a user