mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-22 13:20:50 +01:00
fix not working copy to clipboard button in filemanager.ts Regarding Ticket #103531
This commit is contained in:
parent
66995e39da
commit
383d8088a6
@ -1419,20 +1419,18 @@ export class filemanagerAPP extends EgwApp
|
|||||||
console.log("_data", _data);
|
console.log("_data", _data);
|
||||||
let app = this;
|
let app = this;
|
||||||
|
|
||||||
let copy_link_to_clipboard = function (evt)
|
let copy_link_to_clipboard = function (evt): Promise<boolean> {
|
||||||
{
|
const target = evt.currentTarget;
|
||||||
let $target = jQuery(evt.target);
|
target.select();
|
||||||
$target.select();
|
target.setSelectionRange(0, 99999) //For mobile devices
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
let successful = document.execCommand('copy');
|
return navigator.clipboard.writeText(target.value).then(() => {
|
||||||
if(successful)
|
|
||||||
{
|
|
||||||
egw.message(app.egw.lang('Share link copied into clipboard'));
|
egw.message(app.egw.lang('Share link copied into clipboard'));
|
||||||
return true;
|
return true;
|
||||||
}
|
})
|
||||||
}
|
|
||||||
catch(e)
|
} catch (e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
egw.message('Failed to copy the link!');
|
egw.message('Failed to copy the link!');
|
||||||
|
Loading…
Reference in New Issue
Block a user