ensure document name in drag info is always a string

even if the name of the document consists of numbers only
This commit is contained in:
Uwe Steinmann 2020-05-12 13:05:33 +02:00
parent b7d61aea43
commit 1e21a41149

View File

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