mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
[IMP] web_drop_target: Make sure is a Blob object
Make sure that when a File is dropped into a form the event is propagated and the action only takes place when the element dropped is actually a Blob object. Taken from #1209 Co-Authored-By: George Daramouskas <daramousk@users.noreply.github.com>
This commit is contained in:
committed by
Jasmin Solanki
parent
6bf9789db4
commit
0aba413c93
@@ -110,6 +110,9 @@ odoo.define('web_drop_target', function(require) {
|
||||
) {
|
||||
var self = this;
|
||||
var file = item;
|
||||
if(!file || !(file instanceof Blob)) {
|
||||
return;
|
||||
}
|
||||
var reader = new FileReader();
|
||||
reader.onloadend = self.proxy(
|
||||
_.partial(self._create_attachment, file, reader, e, res_model, res_id, extra_data)
|
||||
|
||||
Reference in New Issue
Block a user