From 1e21a4114928b934618f12ad68410e49b224cf3e Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 12 May 2020 13:05:33 +0200 Subject: [PATCH] ensure document name in drag info is always a string even if the name of the document consists of numbers only --- styles/bootstrap/application.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/styles/bootstrap/application.js b/styles/bootstrap/application.js index 6aaba78e9..ca7452c13 100644 --- a/styles/bootstrap/application.js +++ b/styles/bootstrap/application.js @@ -758,7 +758,7 @@ $(document).ready(function() { /* {{{ */ attr_rel = $(e.currentTarget).data('droptarget'); target_type = attr_rel.split("_")[0]; target_id = attr_rel.split("_")[1]; - target_name = $(e.currentTarget).data('name') + target_name = $(e.currentTarget).data('name')+''; // Force this to be a string if(target_type == 'folder') { var files = e.originalEvent.dataTransfer.files; if(files.length > 0) { @@ -769,7 +769,7 @@ $(document).ready(function() { /* {{{ */ source_type = source_info.type; source_id = source_info.id; formtoken = source_info.formtoken; - console.log('Drop '+source_type+' '+source_id+' on '+target_type+' '+target_id); +// console.log('Drop '+source_type+' '+source_id+' on '+target_type+' '+target_id); if(source_type == 'document') { var bootbox_message = trans.confirm_move_document; if(source_info.name) @@ -956,7 +956,7 @@ $(document).ready(function() { /* {{{ */ id : attr_rel.split("_")[1], type : "folder", formtoken : $(e.target).attr('formtoken'), - name: $(e.target).data('name') + name: $(e.target).data('name')+'' }; /* Currently not used $.ajax({url: '../out/out.ViewFolder.php', @@ -982,7 +982,7 @@ $(document).ready(function() { /* {{{ */ id : attr_rel.split("_")[1], type : "document", formtoken : $(e.target).attr('formtoken'), - name: $(e.target).data('name') + name: $(e.target).data('name')+'' }; e.originalEvent.dataTransfer.setData("text", JSON.stringify(dragStartInfo)); });