From d8465dec6cbf4c8acd9a209e8e35715fd3047e1b Mon Sep 17 00:00:00 2001 From: Lucas Gass Date: Thu, 22 Apr 2021 20:45:06 +0000 Subject: [PATCH] Bug 28196: make sure hash is always appended last To test: -Do a search within the staff client -Click on any results and go to the detail page -Click the edit button on any item in that record, you will be taken to the edit item screen but you will not be taken to the

placeholder -Apply patch and try again -This time when taken to the edit item screen you should be placed right at the

placeholder --- koha-tmpl/intranet-tmpl/js/browser.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js index 19d707376e..8eb702a0fe 100644 --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ b/koha-tmpl/intranet-tmpl/js/browser.js @@ -103,10 +103,16 @@ KOHA.browser = function (searchid, biblionumber) { ev.preventDefault(); browseRecords(1); }); - $('a[href*="biblionumber="]').not('a[target="_blank"]').click(function (ev) { + $('a[href*="biblionumber="]').not('a[target="_blank"]').not('a[href*=\\#]').click(function (ev) { ev.preventDefault(); window.location = $(this).attr('href') + '&searchid=' + me.searchid; }); + $('a[href*="biblionumber="][href*=\\#]').not('a[target="_blank"]').click(function (ev) { + ev.preventDefault(); + var hash = $(this).attr('href').substring( $(this).attr('href').indexOf('#') + 1 ) + var split = $(this).attr('href').split('#' + hash); + window.location = split[0] + '&searchid=' + me.searchid + '#' + hash; + }); $('form[name="f"]').append(''); } }); -- 2.11.0