From c72f6e6ea8d363c43de27760a2374230ce521606 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Jul 2018 10:42:16 +0200 Subject: fix jot drag and drop --- view/tpl/jot-header.tpl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 365a922f9..cd8e3e97c 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -482,10 +482,13 @@ var activeCommentText = ''; } - // file drag hover - function DragDropUploadFileHover(e) { - e.target.className = (e.type == "dragover" ? "hover" : ""); - } + // file drag hover + function DragDropUploadFileHover(e) { + if(e.type == 'dragover') + $(e.target).addClass('hover'); + else + $(e.target).removeClass('hover'); + } // file selection function DragDropUploadFileSelectHandler(e) { @@ -494,7 +497,7 @@ var activeCommentText = ''; DragDropUploadFileHover(e); // open editor if it isn't yet initialised if (!editor) { - initEditor(); + enableOnUser(); } linkdrop(e); @@ -586,7 +589,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del openEditor = true; } if(openEditor) { - initEditor(); + enableOnUser(); } } else { postSaveChanges('clean'); -- cgit v1.2.3 From f6de91bf0fe1abf41d9b15a553ba378e42a956d1 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Fri, 20 Jul 2018 16:44:43 +0200 Subject: prevent double file uploads when dropping files into jot --- view/tpl/jot-header.tpl | 1 + 1 file changed, 1 insertion(+) (limited to 'view/tpl/jot-header.tpl') diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index cd8e3e97c..dd64c3454 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -97,6 +97,7 @@ var activeCommentText = ''; $('#invisible-comment-upload').fileupload({ url: 'wall_attach/{{$nickname}}', dataType: 'json', + dropZone: $(), maxChunkSize: 4 * 1024 * 1024, add: function(e,data) { -- cgit v1.2.3