mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	Use jQuery on() consistently in avatar.js.
(imported from commit c14105dbaa174ef9aec4fc11a12a44f25e74a246)
This commit is contained in:
		@@ -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();
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user