mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-28 02:43:22 +01:00
Api: Fix browser cached VFS customfield icon, so it looked like it wasn't changing when you choose a different file
This commit is contained in:
parent
b32b4338ed
commit
e3c7831bc5
@ -960,18 +960,32 @@ export class et2_customfields_list extends et2_valueWidget implements et2_IDetac
|
||||
document.querySelectorAll('et2-link-list').forEach(l => {l.get_links();});
|
||||
|
||||
// Show file(s)
|
||||
const list = e.target.getParent().getWidgetById(attrs.id);
|
||||
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;
|
||||
info.path = "/apps/" + e.target.methodId.replaceAll(":", "/");
|
||||
// Clear list here, _addFile won't replace with the cachebuster
|
||||
list.list.empty();
|
||||
list._children.forEach((c) =>
|
||||
{
|
||||
if(typeof c.remove == "function")
|
||||
{
|
||||
c.remove();
|
||||
}
|
||||
e.target.getParent().getWidgetById(attrs.id)?._addFile(info);
|
||||
c.getParent().removeChild(c);
|
||||
c.destroy();
|
||||
});
|
||||
e.target.getParent().getWidgetById(attrs.id).getDOMNode().classList.remove("hideme");
|
||||
info.name = field.name;
|
||||
|
||||
// Use a cache buster since file has the same name
|
||||
info.path = "/apps/" + e.target.methodId.replaceAll(":", "/") + "#" + new Date().getTime();
|
||||
}
|
||||
list?._addFile(info);
|
||||
});
|
||||
list.getDOMNode().classList.remove("hideme");
|
||||
});
|
||||
jQuery(widget.getDOMNode(widget)).css('vertical-align','top').prependTo(cf);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user