mirror of https://github.com/zulip/zulip.git
Allow drag&drop for setting bot avatar image.
(imported from commit e480c1a5efdd08621e80ef3e8653beb5a9f095d8)
This commit is contained in:
parent
2d888dbb23
commit
bb4aafb7b0
|
@ -52,6 +52,16 @@ $(function () {
|
|||
control.replaceWith(new_control);
|
||||
}
|
||||
|
||||
$('#bot_avatar_file_input').on('drop', function(e) {
|
||||
var files = e.dataTransfer.files;
|
||||
if (files === null || files === undefined || files.length === 0) {
|
||||
return false;
|
||||
}
|
||||
this.files = files;
|
||||
e.preventDefault();
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#bot_avatar_file_input').change(function(e) {
|
||||
if (e.target.files.length === 0) {
|
||||
$('#bot_avatar_file_input_error').hide();
|
||||
|
|
Loading…
Reference in New Issue