Use jQuery on() consistently in avatar.js.

(imported from commit c14105dbaa174ef9aec4fc11a12a44f25e74a246)
This commit is contained in:
Steve Howell 2013-07-31 13:31:12 -04:00
parent ab23c534b9
commit 784cab9df2
1 changed files with 4 additions and 6 deletions

View File

@ -62,7 +62,7 @@ exports.set_up_file_input = function (
upload_button.show();
}
clear_button.click(function (e) {
clear_button.on('click', function (e) {
clear();
e.preventDefault();
});
@ -77,7 +77,7 @@ exports.set_up_file_input = function (
return false;
});
var validate_avatar = function (e) {
get_file_input().on('change', function (e) {
if (e.target.files.length === 0) {
input_error.hide();
} else if (e.target.files.length === 1) {
@ -98,11 +98,9 @@ exports.set_up_file_input = function (
else {
input_error.text('Please just upload one file.');
}
};
});
get_file_input().change(validate_avatar);
upload_button.click(function (e) {
upload_button.on('click', function (e) {
get_file_input().trigger('click');
e.preventDefault();
});