From: Jeff Godin Date: Sun, 15 Apr 2012 03:41:59 +0000 (-0400) Subject: Show reviews/anotes by default if found X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=92ea01bfa356f8e23053c4f6b97faf59bb610db9;p=evergreen%2Ftadl.git 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 --- 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 @@ - - + + - - + +