From 784cab9df2041b2331d100cec82654f3c3a76b92 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Wed, 31 Jul 2013 13:31:12 -0400 Subject: [PATCH] Use jQuery on() consistently in avatar.js. (imported from commit c14105dbaa174ef9aec4fc11a12a44f25e74a246) --- static/js/avatar.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/static/js/avatar.js b/static/js/avatar.js index e4d5a0a5c0..bfc2f1d7a6 100644 --- a/static/js/avatar.js +++ b/static/js/avatar.js @@ -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(); });