From 026b36dff5e49e9f80fef5e48394c73ec34d5931 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 Jan 2022 11:10:34 +0100 Subject: [PATCH] Bug 11873: Remove decoration on current authority Previously the current authority was not styled like a link. It was useful to have a visual feedback knowing which authority is currently displayed. Signed-off-by: Jonathan Druart Signed-off-by: Fridolin Somers --- .../prog/en/modules/authorities/detail.tt | 7 ++++++- .../bootstrap/en/modules/opac-auth-MARCdetail.tt | 7 ++++++- .../opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt index 1234fe1f6b..f55176b935 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt @@ -151,7 +151,12 @@ } }, "plugins" : [ "types" ] - }).on('ready.jstree', function(){ $(this).jstree('open_all') + }).on('ready.jstree', function(){ + $(this).jstree('open_all'); + $("#hier"+[% authid %]+"_anchor").on("click", + function(e){e.preventDefault(); return false;} + ).css("text-decoration", "none").css("color", "#333"); + $(".currentauth").css("text-decoration", "none").css("color", "#333"); }).bind("select_node.jstree", function (e, data) { e.preventDefault(); document.location.href = data.node.a_attr.href; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt index c6dea95386..724f8c7d9a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-MARCdetail.tt @@ -91,7 +91,12 @@ } }, "plugins" : [ "types" ] - }).on('ready.jstree', function(){ $(this).jstree('open_all') + }).on('ready.jstree', function(){ + $(this).jstree('open_all') + $("#hier"+[% authid %]+"_anchor").on("click", + function(e){e.preventDefault(); return false;} + ).css("text-decoration", "none").css("color", "#333"); + $(".currentauth").css("text-decoration", "none").css("color", "#333"); }).bind("select_node.jstree", function (e, data) { e.preventDefault(); document.location.href = data.node.a_attr.href; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt index 530b1e4090..0f14a2c151 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth-detail.tt @@ -13,6 +13,9 @@ [% Asset.css("lib/jquery/plugins/jstree/themes/default/style.min.css") | $raw %] [% END %] [% END %] +[%# FIXME authid is modified when passed authheadingdisplay %] +[%# It's then wrong in the JS %] +[% SET original_authid = authid %] [% INCLUDE 'bodytag.inc' bodyid='opac-authoritiesdetail' bodyclass='scrollto' %] [% INCLUDE 'masthead.inc' %] @@ -183,7 +186,12 @@ } }, "plugins" : [ "types" ] - }).on('ready.jstree', function(){ $(this).jstree('open_all') + }).on('ready.jstree', function(){ + $(this).jstree('open_all'); + $("#hier"+[% original_authid %]+"_anchor").on("click", + function(e){e.preventDefault(); return false;} + ).css("text-decoration", "none").css("color", "#333"); + $(".currentauth").css("text-decoration", "none").css("color", "#333"); }).bind("select_node.jstree", function (e, data) { e.preventDefault(); document.location.href = data.node.a_attr.href; -- 2.39.5