From fa61007990749fe89403ff3e1e8c2f1543468691 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 28 Mar 2011 17:26:42 -0400 Subject: [PATCH] in the staff client, when only 1 record is found for a search, redirect to the record detail page; prevent unintended redirection when user uses Back button from rdetail --- Open-ILS/web/opac/skin/default/js/rresult.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Open-ILS/web/opac/skin/default/js/rresult.js b/Open-ILS/web/opac/skin/default/js/rresult.js index ff94bb8158..6ca4a74469 100644 --- a/Open-ILS/web/opac/skin/default/js/rresult.js +++ b/Open-ILS/web/opac/skin/default/js/rresult.js @@ -279,6 +279,18 @@ function rresultCollectRecords(ids, base) { runEvt("result", "preCollectRecords"); var x = 0; + // don't perform rdetail redirect if user was on rdetail and cliecked Back + if(findCurrentPage() == RRESULT && isXUL()) { + if(ids.length == 1 && !xulG.fromBack) { + var args = {}; + args.page = RDETAIL; + args[PARAM_OFFSET] = 0; + args[PARAM_RID] = ids[0]; + location.href = buildOPACLink(args); + } + } + } + if (!base) base = 0; if( rresultIsPaged ) base = 0; -- 2.11.0