Fixed Codacy
This commit is contained in:
parent
88345a626c
commit
b02b48a3ce
2 changed files with 9 additions and 12 deletions
|
|
@ -6,7 +6,7 @@ frappe.ui.DropZone = class
|
|||
this.$container = $(selector);
|
||||
this.$wrapper = $(frappe.ui.DropZone.TEMPLATE);
|
||||
|
||||
this.make()
|
||||
this.make();
|
||||
}
|
||||
|
||||
make ( ) {
|
||||
|
|
@ -15,20 +15,17 @@ frappe.ui.DropZone = class
|
|||
const $title = $dropzone.find('.dropzone-title');
|
||||
$title.html(this.options.title);
|
||||
|
||||
$dropzone.on('dragover',
|
||||
function (e) {
|
||||
$dropzone.on('dragover', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$title.html('Drop');
|
||||
});
|
||||
$dropzone.on('dragleave',
|
||||
function (e) {
|
||||
$dropzone.on('dragleave', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$title.html(me.options.title);
|
||||
});
|
||||
$dropzone.on('drop',
|
||||
function (e) {
|
||||
$dropzone.on('drop', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
const files = e.originalEvent.dataTransfer.files;
|
||||
|
|
@ -53,8 +50,8 @@ frappe.ui.DropZone.TEMPLATE =
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
`;
|
||||
frappe.ui.DropZone.OPTIONS =
|
||||
{
|
||||
title: 'Drop Here'
|
||||
}
|
||||
};
|
||||
|
|
@ -43,11 +43,11 @@ frappe.upload = {
|
|||
|
||||
// dropzone upload
|
||||
const $dropzone = $('<div style="padding: 20px 10px 0px 10px;"/>');
|
||||
const dropzone = new frappe.ui.DropZone($dropzone, {
|
||||
new frappe.ui.DropZone($dropzone, {
|
||||
drop: function (files) {
|
||||
$dropzone.hide();
|
||||
|
||||
opts.files = opts.files ? [...opts.files, ...files] : files
|
||||
opts.files = opts.files ? [...opts.files, ...files] : files;
|
||||
|
||||
$file_input.trigger('change');
|
||||
}
|
||||
|
|
@ -73,7 +73,7 @@ frappe.upload = {
|
|||
$upload.find(".web-link-wrapper").addClass("hidden");
|
||||
$upload.find(".btn-browse").removeClass("btn-primary").addClass("btn-default");
|
||||
$uploaded_files_wrapper.removeClass('hidden').empty();
|
||||
$uploaded_files_wrapper.css({ 'margin-bottom': '25px' })
|
||||
$uploaded_files_wrapper.css({ 'margin-bottom': '25px' });
|
||||
|
||||
file_array = file_array.map(
|
||||
file => Object.assign(file, {is_private: opts.is_private ? 1 : 0})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue