user avatar: Remove user_avatar_file_input id.

Now we can remove `user-avatar-block` id and added new class
'image_file_input'.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:
jagansivam28
2020-06-15 11:29:13 +05:30
committed by Tim Abbott
parent 4fe066c437
commit c141daa624
2 changed files with 2 additions and 2 deletions

View File

@@ -42,7 +42,7 @@ exports.build_bot_edit_widget = function (target) {
exports.build_user_avatar_widget = function (upload_function) { exports.build_user_avatar_widget = function (upload_function) {
const get_file_input = function () { const get_file_input = function () {
return $('#user_avatar_file_input').expectOne(); return $('#user-avatar-upload-widget .image_file_input').expectOne();
}; };
if (page_params.avatar_source === 'G') { if (page_params.avatar_source === 'G') {

View File

@@ -17,6 +17,6 @@
</div> </div>
{{/if}} {{/if}}
<img class="image-block" src="{{ image }}"/> <img class="image-block" src="{{ image }}"/>
<input type="file" name="user_avatar_file_input" class="notvisible" id="user_avatar_file_input" value="{{t 'Upload profile picture' }}" /> <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 id="user_avatar_file_input_error" class="text-error"></div>
</div> </div>