From 5fa5632b905ceca5db77197b39987265631c5572 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 --- 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 5dd334a61b..483d9a18db 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.39.5