create stream: Add div element indicating stream creation result.

Add div element to inform user whether stream is successfully
created or not. This will help to inform user in case if current
user is not subscribed to created stream.
This commit is contained in:
YJDave
2018-01-16 23:01:15 +05:30
committed by Tim Abbott
parent 3280135a4c
commit c3a289b473
3 changed files with 8 additions and 2 deletions

View File

@@ -87,9 +87,9 @@ function ajaxSubscribeForCreation(stream_name, description, principals, invite_o
announce: JSON.stringify(announce), announce: JSON.stringify(announce),
}, },
success: function () { success: function () {
$(".stream_change_property_info").hide();
$("#create_stream_name").val(""); $("#create_stream_name").val("");
$("#create_stream_description").val(""); $("#create_stream_description").val("");
ui_report.success(i18n.t("Stream successfully created!"), $(".stream_create_info"));
loading.destroy_indicator($('#stream_creating_indicator')); loading.destroy_indicator($('#stream_creating_indicator'));
// The rest of the work is done via the subscribe event we will get // The rest of the work is done via the subscribe event we will get
}, },
@@ -102,7 +102,7 @@ function ajaxSubscribeForCreation(stream_name, description, principals, invite_o
stream_name_error.select(); stream_name_error.select();
} }
ui_report.error(i18n.t("Error creating stream"), xhr, $(".stream_change_property_info")); ui_report.error(i18n.t("Error creating stream"), xhr, $(".stream_create_info"));
loading.destroy_indicator($('#stream_creating_indicator')); loading.destroy_indicator($('#stream_creating_indicator'));
}, },
}); });
@@ -223,6 +223,7 @@ exports.show_new_stream_modal = function () {
} }
stream_name_error.clear_errors(); stream_name_error.clear_errors();
$(".stream_create_info").hide();
$("#stream-checkboxes label.checkbox").on('change', function (e) { $("#stream-checkboxes label.checkbox").on('change', function (e) {
var elem = $(this); var elem = $(this);

View File

@@ -11,6 +11,10 @@
margin: 20px; margin: 20px;
} }
.alert.stream_create_info {
margin: 10px 10px 0px 10px;
}
/* alert box compoent changes */ /* alert box compoent changes */
.alert-box { .alert-box {
position: absolute; position: absolute;

View File

@@ -1,6 +1,7 @@
<div class="hide" id="stream-creation" tabindex="-1" role="dialog" <div class="hide" id="stream-creation" tabindex="-1" role="dialog"
aria-label="{{t 'Stream creation' }}"> aria-label="{{t 'Stream creation' }}">
<form id="stream_creation_form" class="form-inline"> <form id="stream_creation_form" class="form-inline">
<div class="alert stream_create_info"></div>
<div id="stream_creating_indicator"></div> <div id="stream_creating_indicator"></div>
<div class="stream-creation-body"> <div class="stream-creation-body">
<section class="block"> <section class="block">