From aed406b167f94bfe6e72cc7ef192e023e975f853 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 27 Aug 2019 14:13:26 +0200 Subject: [PATCH] check for data-no-spinner, make drag&drop work if loaded by ajax --- styles/bootstrap/application.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 58a74605a..294679d58 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -405,7 +405,8 @@ $(document).ready( function() { } else { url += "&"+param1; } - element.prepend('
'); + if(!element.data('no-spinner')) + element.prepend('
'); $.get(url, function(data) { element.html(data); $(".chzn-select").select2({ @@ -571,7 +572,7 @@ function onAddClipboard(ev) { /* {{{ */ processData: false, cache: false, data: formData, - success: function(data){ + success: function(data, textStatus) { status.setProgress(100); if(data.success) { noty({ @@ -707,26 +708,25 @@ function onAddClipboard(ev) { /* {{{ */ }( window.SeedDMSUpload = window.SeedDMSUpload || {}, jQuery )); /* }}} */ $(document).ready(function() { /* {{{ */ - var obj = $("#dragandrophandler"); - obj.on('dragenter', function (e) { + $(document).on('dragenter', "#dragandrophandler", function (e) { e.stopPropagation(); e.preventDefault(); $(this).css('border', '2px dashed #0B85A1'); }); - obj.on('dragleave', function (e) { + $(document).on('dragleave', "#dragandrophandler", function (e) { $(this).css('border', '0px solid white'); }); - obj.on('dragover', function (e) { + $(document).on('dragover', "#dragandrophandler", function (e) { e.stopPropagation(); e.preventDefault(); }); - obj.on('drop', function (e) { + $(document).on('drop', "#dragandrophandler", function (e) { $(this).css('border', '0px dotted #0B85A1'); e.preventDefault(); var files = e.originalEvent.dataTransfer.files; //We need to send dropped files to Server - SeedDMSUpload.handleFileUpload(files,obj, obj); + SeedDMSUpload.handleFileUpload(files, $(this), $(this)); }); $(document).on('dragenter', '.droptarget', function (e) {