From 92ea01bfa356f8e23053c4f6b97faf59bb610db9 Mon Sep 17 00:00:00 2001 From: Jeff Godin Date: Sat, 14 Apr 2012 23:41:59 -0400 Subject: [PATCH] Show reviews/anotes by default if found If the added content handler found reviews or author notes, show that information by default (first reviews, then author notes if there were no reviews). If neither are found, show nothing by default -- but things like Table of Contents or Excerpts will still be available by clicking the proper link. Signed-off-by: Jeff Godin --- Open-ILS/web/opac/skin/tadlv3/js/rdetail.js | 7 +++++++ .../skin/tadlv3/xml/rdetail/rdetail_extras.xml | 24 +++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js index db7e25a418..58b310cd9d 100644 --- a/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js +++ b/Open-ILS/web/opac/skin/tadlv3/js/rdetail.js @@ -881,6 +881,8 @@ function rdetailShowCNBrowse( cn, loc, depth, fromOnclick ) { function rdetailhandleAC(data) { + var found_review = false; + if( data.summary.html ) { $('rdetail_summary_div').innerHTML = data.summary.html; unHideMe($('rdetail_summary_link')); @@ -888,7 +890,9 @@ function rdetailhandleAC(data) { if( data.reviews.html ) { $('rdetail_review_container').innerHTML = data.reviews.html; + found_review = true; unHideMe($('rdetail_reviews_link')); + rdetailShowExtra('reviews'); } if( data.toc.html ) { @@ -904,6 +908,9 @@ function rdetailhandleAC(data) { if( data.anotes.html ) { $('rdetail_anotes_div').innerHTML = data.anotes.html; unHideMe($('rdetail_anotes_link')); + if (!found_review) { + rdetailShowExtra('anotes'); + } } } diff --git a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml index c9f563ecdc..4003f97061 100644 --- a/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml +++ b/Open-ILS/web/opac/skin/tadlv3/xml/rdetail/rdetail_extras.xml @@ -4,12 +4,6 @@ - - + + - - + +