Filemanager: Fix sharing link doesn't copy to clipboard when you click it

This commit is contained in:
nathan 2022-02-14 10:20:04 -07:00
parent d2020727fe
commit a3d31f5a4b

View File

@ -1285,8 +1285,9 @@ export class filemanagerAPP extends EgwApp
egw.message('Failed to copy the link!');
};
jQuery("body").on("click", "[name=share_link]", copy_link_to_clipboard);
et2_createWidget("dialog", {
callback: function() {
let dialog = et2_createWidget("dialog", {
callback: function()
{
jQuery("body").off("click", "[name=share_link]", copy_link_to_clipboard);
return true;
},
@ -1297,6 +1298,10 @@ export class filemanagerAPP extends EgwApp
width: 450,
value: {content:{ "share_link": _data.share_link }}
});
jQuery(dialog.template.DOMContainer).on("load", () =>
{
dialog.template.widgetContainer.getWidgetById("share_link").onclick = copy_link_to_clipboard;
});
}
/**