mirror of https://github.com/zulip/zulip.git
user avatar: Remove `user_avatar_file_input_error` id.
Now we can remove `user_avatar_file_input_error` id and added new class `image_file_input_error`.we can access this class using `#user-avatar-upload-widget .image_file_input` so that we can have only one id at top-level and 'image_upload_widget.hbs` can be more dynamic so we can use for other similar widgets also.
This commit is contained in:
parent
c141daa624
commit
4576742b2f
|
@ -71,7 +71,7 @@ exports.build_user_avatar_widget = function (upload_function) {
|
||||||
if (settings_account.user_can_change_avatar()) {
|
if (settings_account.user_can_change_avatar()) {
|
||||||
return upload_widget.build_direct_upload_widget(
|
return upload_widget.build_direct_upload_widget(
|
||||||
get_file_input,
|
get_file_input,
|
||||||
$("#user_avatar_file_input_error").expectOne(),
|
$("#user-avatar-upload-widget .image_file_input_error").expectOne(),
|
||||||
$("#user-avatar-upload-widget .image_upload_button").expectOne(),
|
$("#user-avatar-upload-widget .image_upload_button").expectOne(),
|
||||||
upload_function,
|
upload_function,
|
||||||
page_params.max_avatar_file_size_mib
|
page_params.max_avatar_file_size_mib
|
||||||
|
|
|
@ -590,7 +590,7 @@ exports.set_up = function () {
|
||||||
contentType: false,
|
contentType: false,
|
||||||
success: function () {
|
success: function () {
|
||||||
display_avatar_upload_complete();
|
display_avatar_upload_complete();
|
||||||
$("#user_avatar_file_input_error").hide();
|
$("#user-avatar-upload-widget .image_file_input_error").hide();
|
||||||
$("#user-avatar-source").hide();
|
$("#user-avatar-source").hide();
|
||||||
// Rest of the work is done via the user_events -> avatar_url event we will get
|
// Rest of the work is done via the user_events -> avatar_url event we will get
|
||||||
},
|
},
|
||||||
|
@ -599,7 +599,7 @@ exports.set_up = function () {
|
||||||
if (page_params.avatar_source === 'G') {
|
if (page_params.avatar_source === 'G') {
|
||||||
$("#user-avatar-source").show();
|
$("#user-avatar-source").show();
|
||||||
}
|
}
|
||||||
const $error = $("#user_avatar_file_input_error");
|
const $error = $("#user-avatar-upload-widget .image_file_input_error");
|
||||||
$error.text(JSON.parse(xhr.responseText).msg);
|
$error.text(JSON.parse(xhr.responseText).msg);
|
||||||
$error.show();
|
$error.show();
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,5 +18,5 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<img class="image-block" src="{{ image }}"/>
|
<img class="image-block" src="{{ image }}"/>
|
||||||
<input type="file" name="file_input" class="notvisible image_file_input" value="{{t upload_text }}" />
|
<input type="file" name="file_input" class="notvisible image_file_input" value="{{t upload_text }}" />
|
||||||
<div id="user_avatar_file_input_error" class="text-error"></div>
|
<div class="image_file_input_error text-error"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue