From dd2a60525d990dadc795b38bf02217145cb105c4 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 Signed-off-by: Jonathan Druart (cherry picked from commit 5fa5632b905ceca5db77197b39987265631c5572) Signed-off-by: Fridolin Somers --- 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 e3d1614ffb..1caeb85fab 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/upload.tt @@ -457,11 +457,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.39.5