mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
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:
parent
b7d61aea43
commit
1e21a41149
|
@ -758,7 +758,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
attr_rel = $(e.currentTarget).data('droptarget');
|
attr_rel = $(e.currentTarget).data('droptarget');
|
||||||
target_type = attr_rel.split("_")[0];
|
target_type = attr_rel.split("_")[0];
|
||||||
target_id = attr_rel.split("_")[1];
|
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') {
|
if(target_type == 'folder') {
|
||||||
var files = e.originalEvent.dataTransfer.files;
|
var files = e.originalEvent.dataTransfer.files;
|
||||||
if(files.length > 0) {
|
if(files.length > 0) {
|
||||||
|
@ -769,7 +769,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
source_type = source_info.type;
|
source_type = source_info.type;
|
||||||
source_id = source_info.id;
|
source_id = source_info.id;
|
||||||
formtoken = source_info.formtoken;
|
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') {
|
if(source_type == 'document') {
|
||||||
var bootbox_message = trans.confirm_move_document;
|
var bootbox_message = trans.confirm_move_document;
|
||||||
if(source_info.name)
|
if(source_info.name)
|
||||||
|
@ -956,7 +956,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
id : attr_rel.split("_")[1],
|
id : attr_rel.split("_")[1],
|
||||||
type : "folder",
|
type : "folder",
|
||||||
formtoken : $(e.target).attr('formtoken'),
|
formtoken : $(e.target).attr('formtoken'),
|
||||||
name: $(e.target).data('name')
|
name: $(e.target).data('name')+''
|
||||||
};
|
};
|
||||||
/* Currently not used
|
/* Currently not used
|
||||||
$.ajax({url: '../out/out.ViewFolder.php',
|
$.ajax({url: '../out/out.ViewFolder.php',
|
||||||
|
@ -982,7 +982,7 @@ $(document).ready(function() { /* {{{ */
|
||||||
id : attr_rel.split("_")[1],
|
id : attr_rel.split("_")[1],
|
||||||
type : "document",
|
type : "document",
|
||||||
formtoken : $(e.target).attr('formtoken'),
|
formtoken : $(e.target).attr('formtoken'),
|
||||||
name: $(e.target).data('name')
|
name: $(e.target).data('name')+''
|
||||||
};
|
};
|
||||||
e.originalEvent.dataTransfer.setData("text", JSON.stringify(dragStartInfo));
|
e.originalEvent.dataTransfer.setData("text", JSON.stringify(dragStartInfo));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user