Fix regression in jfiletree

This commit is contained in:
Laurent Destailleur 2022-10-13 22:12:51 +02:00
parent 9447bcc881
commit 14099b100e
4 changed files with 17 additions and 4 deletions

View File

@ -414,13 +414,15 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
}
print '<li class="directory '.$collapsedorexpanded.' lidirecm">'; // collapsed is opposite if expanded
print '<div class="divfmdirlia inline-block"><a class="fmdirlia jqft ecmjqft" href="';
//print '<div class="divfmdirlia inline-block">'; // Disabled, this break the javascrip component
print '<a class="fmdirlia jqft ecmjqft" href="';
print "#";
print "\" rel=\"".dol_escape_htmltag($val['fullrelativename'].'/')."\" id=\"fmdirlia_id_".$val['id']."\"";
print " onClick=\"loadandshowpreview('".dol_escape_js($val['fullrelativename'])."',".$val['id'].")";
print "\">";
print dol_escape_htmltag($file);
print "</a></div>";
print '</a>';
//print '</div>';
print '<div class="ecmjqft">';

View File

@ -24,6 +24,7 @@ if (empty($conf) || !is_object($conf)) {
print "Error, template enablefiletreeajax.tpl.php can't be called as URL";
exit;
}
// Must have set $module, $nameforformuserfile, $preopened
?>
@ -57,7 +58,7 @@ $(document).ready(function() {
multiFolder: false },
// Called if we click on a file (not a dir)
function(file) {
console.log("We click on a file");
console.log("We click on a file "+file);
$("#mesg").hide();
loadandshowpreview(file,0);
},
@ -65,7 +66,7 @@ $(document).ready(function() {
function(elem) {
id=elem.attr('id').substr(12); // We get id that is 'fmdirlia_id_xxx' (id we want is xxx)
rel=elem.attr('rel')
console.log("We click on a dir, we call the ajaxdirtree.php with modulepart=<?php echo $module; ?>, param=<?php echo $paramwithoutsection; ?>");
console.log("We click on a dir id="+id+", we call the ajaxdirtree.php with modulepart=<?php echo $module; ?>, param=<?php echo $paramwithoutsection; ?>");
console.log("We also save id and dir name into <?php echo $nameforformuserfile ?>_section_id|dir (vars into form to attach new file in filemanager.tpl.php) with id="+id+" and rel="+rel);
jQuery("#<?php echo $nameforformuserfile ?>_section_dir").val(rel);
jQuery("#<?php echo $nameforformuserfile ?>_section_id").val(id);

View File

@ -5889,6 +5889,11 @@ ul.ecmjqft a {
padding: 0px 0px;
font-weight:normal;
display: inline-block !important;
width: calc(100% - 100px);
overflow: hidden;
white-space: break-spaces;
word-break: break-all;
}
ul.ecmjqft a:active {
font-weight: bold !important;

View File

@ -5722,6 +5722,11 @@ ul.ecmjqft a {
padding: 0px 0px;
font-weight:normal;
display: inline-block !important;
width: calc(100% - 100px);
overflow: hidden;
white-space: break-spaces;
word-break: break-all;
}
ul.ecmjqft a:active {
font-weight: bold !important;