|
@ -26,6 +26,7 @@ var _t = core._t; |
|
|
var QWeb = core.qweb; |
|
|
var QWeb = core.qweb; |
|
|
|
|
|
|
|
|
var DropzoneMixin = { |
|
|
var DropzoneMixin = { |
|
|
|
|
|
dropzoneData: {}, |
|
|
dropzoneClasses: 'mk_dropzone', |
|
|
dropzoneClasses: 'mk_dropzone', |
|
|
dropzoneEvents: { |
|
|
dropzoneEvents: { |
|
|
'dragenter .o_form_sheet': '_dragenterDropzone', |
|
|
'dragenter .o_form_sheet': '_dragenterDropzone', |
|
@ -42,7 +43,9 @@ var DropzoneMixin = { |
|
|
'dndHoverStart': this._hoverDropzoneEnter.bind(this), |
|
|
'dndHoverStart': this._hoverDropzoneEnter.bind(this), |
|
|
'dndHoverEnd': this._hoverDropzoneLeave.bind(this), |
|
|
'dndHoverEnd': this._hoverDropzoneLeave.bind(this), |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
_.each(this.dropzoneData, function(value, key) { |
|
|
|
|
|
this.$dropzone.attr(key, value) |
|
|
|
|
|
}, this); |
|
|
}, |
|
|
}, |
|
|
_toggleDropzone: function(state) { |
|
|
_toggleDropzone: function(state) { |
|
|
this.$dropzone.toggleClass(this.dropzoneClasses, state); |
|
|
this.$dropzone.toggleClass(this.dropzoneClasses, state); |
|
@ -90,6 +93,9 @@ var DropzoneMixin = { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
var FileDropzoneMixin = _.extend({}, DropzoneMixin, { |
|
|
var FileDropzoneMixin = _.extend({}, DropzoneMixin, { |
|
|
|
|
|
dropzoneData: { |
|
|
|
|
|
'data-dropzone-text': _t("Drop files here to upload!"), |
|
|
|
|
|
}, |
|
|
dropzoneClasses: DropzoneMixin.dropzoneClasses + ' mk_dropzone_file', |
|
|
dropzoneClasses: DropzoneMixin.dropzoneClasses + ' mk_dropzone_file', |
|
|
_checkDropzoneEvent: function(event) { |
|
|
_checkDropzoneEvent: function(event) { |
|
|
return window.File && window.FileReader && window.FileList && window.Blob; |
|
|
return window.File && window.FileReader && window.FileList && window.Blob; |
|
|