mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 15:33:23 +01:00
Et2Link fixes
- fix Vfs customfield with multiple didn't update UI after linking files
- fix Vfs customfield without multiple didn't link, broken by 65caab5
This commit is contained in:
parent
15f405bd9c
commit
4448d39bfa
@ -956,9 +956,20 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
|
||||
// Update link list & show file in upload
|
||||
widget.addEventListener("change", (e) =>
|
||||
{
|
||||
// Update lists
|
||||
document.querySelectorAll('et2-link-list').forEach(l => {l.get_links();});
|
||||
const info = e.target._dialog.fileInfo(e.target.value);
|
||||
e.target.getParent().getWidgetById(attrs.id)?._addFile(info);
|
||||
|
||||
// Show file(s)
|
||||
const value = typeof e.target.value == "string" ? [e.target.value] : e.target.value;
|
||||
value.forEach(v =>
|
||||
{
|
||||
const info = e.target._dialog.fileInfo(v);
|
||||
if(!e.target.multiple)
|
||||
{
|
||||
info.name = field.name;
|
||||
}
|
||||
e.target.getParent().getWidgetById(attrs.id)?._addFile(info);
|
||||
});
|
||||
e.target.getParent().getWidgetById(attrs.id).getDOMNode().classList.remove("hideme");
|
||||
});
|
||||
jQuery(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
|
||||
|
@ -314,7 +314,7 @@ class Link extends Etemplate\Widget
|
||||
}
|
||||
else
|
||||
{
|
||||
if(!str_ends_with($dest_file, '/') && count($files) == 1 && is_int($id))
|
||||
if(!str_ends_with($dest_file, '/') && count($files) == 1)
|
||||
{
|
||||
// 1 file to a specific filename
|
||||
Api\Vfs::symlink($files[0], Api\Link::vfs_path($app, $id));
|
||||
|
Loading…
Reference in New Issue
Block a user