mirror of
https://github.com/zulip/zulip.git
synced 2025-11-07 15:33:30 +00:00
stream_create: Extract get_principals.
This commit is contained in:
@@ -134,6 +134,15 @@ function update_announce_stream_state() {
|
|||||||
$('#announce-new-stream').show();
|
$('#announce-new-stream').show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_principals() {
|
||||||
|
return _.map(
|
||||||
|
$("#stream_creation_form input:checkbox[name=user]:checked"),
|
||||||
|
function (elem) {
|
||||||
|
return $(elem).val();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
exports.new_stream_clicked = function (stream) {
|
exports.new_stream_clicked = function (stream) {
|
||||||
// this changes the tab switcher (settings/preview) which isn't necessary
|
// this changes the tab switcher (settings/preview) which isn't necessary
|
||||||
// to a add new stream title.
|
// to a add new stream title.
|
||||||
@@ -291,12 +300,7 @@ $(function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var principals = _.map(
|
var principals = get_principals();
|
||||||
$("#stream_creation_form input:checkbox[name=user]:checked"),
|
|
||||||
function (elem) {
|
|
||||||
return $(elem).val();
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
// You are always subscribed to streams you create.
|
// You are always subscribed to streams you create.
|
||||||
principals.push(people.my_current_email());
|
principals.push(people.my_current_email());
|
||||||
|
|||||||
Reference in New Issue
Block a user