Browse Source

publish muk_web_utils - 12.0

pull/35/head
MuK IT GmbH 6 years ago
parent
commit
711d6eacd4
  1. 8
      muk_web_utils/static/src/js/core/dropzone.js
  2. 2
      muk_web_utils/static/src/scss/dropzone.scss

8
muk_web_utils/static/src/js/core/dropzone.js

@ -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;

2
muk_web_utils/static/src/scss/dropzone.scss

@ -54,7 +54,7 @@
&:after { &:after {
padding-top: 18rem; padding-top: 18rem;
font-size: 3rem; font-size: 3rem;
content: "Drop files here to upload!";
content: attr(data-dropzone-text);
} }
} }
} }
Loading…
Cancel
Save