From 8b3b7e813f3d2e598d271b726da62575e8b4d70e Mon Sep 17 00:00:00 2001 From: Victor Grousset/tuxayo Date: Tue, 6 Apr 2021 20:10:22 +0200 Subject: [PATCH] Bug 27594: (QA follow-up): Display message only if copy worked And check if writeText is available. Signed-off-by: David Nind --- koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt index 8febb0a13f..ae80f542ed 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -471,11 +471,11 @@ $(".get-file").on("click", function(e){ e.preventDefault(); - if( navigator.clipboard ){ + if( navigator.clipboard && navigator.clipboard.writeText){ navigator.clipboard.writeText( $(this).attr("href") ); + $(this).attr("data-original-title", _( "Link copied to the clipboard" ) ) + .tooltip("show"); } - $(this).attr("data-original-title", _( "Link copied to the clipboard" ) ) - .tooltip("show"); }); $(".get-file").tooltip({ delay: { "show": 100, "hide": 500 } -- 2.11.0