From b5f7f2c5af8f40ad6f4ef3050b9bd1fa41666b83 Mon Sep 17 00:00:00 2001 From: Jared Camins-Esakov Date: Mon, 10 Sep 2012 04:37:00 -0400 Subject: [PATCH] Bug 8523 follow-up: always open tree to current node Content-Type: text/plain; charset="UTF-8" --- .../intranet-tmpl/prog/en/includes/authorities.inc | 2 +- .../prog/en/modules/authorities/detail.tt | 6 +++++- .../prog/en/includes/opac-authorities.inc | 2 +- .../prog/en/modules/opac-auth-MARCdetail.tt | 6 +++++- .../opac-tmpl/prog/en/modules/opac-auth-detail.tt | 6 +++++- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc index f782875..5724f34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities.inc @@ -8,7 +8,7 @@ [% FOREACH node IN tree %]
  • [% IF ( node.current_value ) %] - [% node.value | html %] + [% node.value | html %] [% ELSE %] [% node.value | html %] [% END %] 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 a635c2e..4d26bdd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/detail.tt @@ -18,11 +18,15 @@ $(document).ready(function() { $('#authoritiestabs').tabs(); [% IF ( displayhierarchy ) %] + var current_nodes = []; + $('.currentauth').each(function() { + current_nodes.push('#' + $(this).parent().parents('li:first').attr('id')); + }); $('#hierarchies').jstree({ "plugins": [ "themes", "html_data"], "themes": { "theme": "classic", "icons": false }, - "core": { "initially_open": [ "#hier[% authid %]" ] } + "core": { "initially_open": current_nodes } }); [% END %] }); diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc index 190b002..2e131bb 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-authorities.inc @@ -8,7 +8,7 @@ [% FOREACH node IN tree %]
  • [% IF ( node.current_value ) %] - [% node.value | html %] + [% node.value | html %] [% ELSE %] [% node.value | html %] [% END %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt index 038f6dc..e1b6bc6 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-MARCdetail.tt @@ -6,11 +6,15 @@ //