mirror of https://github.com/zulip/zulip.git
Use jQuery on() consistently in avatar.js.
(imported from commit c14105dbaa174ef9aec4fc11a12a44f25e74a246)
This commit is contained in:
parent
ab23c534b9
commit
784cab9df2
|
@ -62,7 +62,7 @@ exports.set_up_file_input = function (
|
||||||
upload_button.show();
|
upload_button.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
clear_button.click(function (e) {
|
clear_button.on('click', function (e) {
|
||||||
clear();
|
clear();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
@ -77,7 +77,7 @@ exports.set_up_file_input = function (
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
var validate_avatar = function (e) {
|
get_file_input().on('change', function (e) {
|
||||||
if (e.target.files.length === 0) {
|
if (e.target.files.length === 0) {
|
||||||
input_error.hide();
|
input_error.hide();
|
||||||
} else if (e.target.files.length === 1) {
|
} else if (e.target.files.length === 1) {
|
||||||
|
@ -98,11 +98,9 @@ exports.set_up_file_input = function (
|
||||||
else {
|
else {
|
||||||
input_error.text('Please just upload one file.');
|
input_error.text('Please just upload one file.');
|
||||||
}
|
}
|
||||||
};
|
});
|
||||||
|
|
||||||
get_file_input().change(validate_avatar);
|
upload_button.on('click', function (e) {
|
||||||
|
|
||||||
upload_button.click(function (e) {
|
|
||||||
get_file_input().trigger('click');
|
get_file_input().trigger('click');
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue