From a816e95072d94d3fc23fd3292ed461e44021c8a7 Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@afi-sa.fr>
Date: Tue, 25 Jul 2017 16:51:00 +0200
Subject: [PATCH] hotline #63041 : fix js detection error on display for
 bloc_contenu div

---
 VERSIONS_HOTLINE/63041      |  1 +
 public/opac/js/recherche.js | 20 ++++++++++----------
 2 files changed, 11 insertions(+), 10 deletions(-)
 create mode 100644 VERSIONS_HOTLINE/63041

diff --git a/VERSIONS_HOTLINE/63041 b/VERSIONS_HOTLINE/63041
new file mode 100644
index 00000000000..dfb5b0552a4
--- /dev/null
+++ b/VERSIONS_HOTLINE/63041
@@ -0,0 +1 @@
+ - ticket #63041 : boites "onglets" : ne se referment pas
\ No newline at end of file
diff --git a/public/opac/js/recherche.js b/public/opac/js/recherche.js
index 664301d2e82..967327d273c 100644
--- a/public/opac/js/recherche.js
+++ b/public/opac/js/recherche.js
@@ -85,23 +85,23 @@ if (undefined == window.blocNoticeAfterLoad)
 
 function infos_bloc(sIdBloc,sIsbn,sType,sCherche,nNiveau,nPage, sUrl) {
   if(sIdBloc.substr(0,1) == "I" ) sIdBloc=sIdBloc.substr(1,sIdBloc.length);
-  oImg=document.getElementById("I" + sIdBloc);
-  oContenu=document.getElementById(sIdBloc + "_contenu");
-  oParent = oImg.parentNode.parentNode;
-
-  if(oContenu.style.display =="block" && !sCherche)	{
+  var oImg=document.getElementById("I" + sIdBloc);
+  var oParent = oImg.parentNode.parentNode;
+  var bloc = $('#'+sIdBloc + '_contenu');
+  
+  if(bloc.is(':visible') && !sCherche)	{
     oImg.setAttribute("src", imagesUrl + "bouton/plus_carre.gif");
     oParent.className = oParent.className.replace(/\b deplier\b/,'');
-    $(oContenu).slideUp();
+    bloc.slideUp();
     return;
   }
 
   oImg.setAttribute("src", imagesUrl + "bouton/moins_carre.gif");
 
   oParent.className= oParent.className+" deplier";
-  $(oContenu).slideDown();
-  nPos=sIdBloc.lastIndexOf("_");
-  nIdNotice=sIdBloc.substr(5,nPos-5);
+  bloc.slideDown();
+  var nPos=sIdBloc.lastIndexOf("_");
+  var nIdNotice=sIdBloc.substr(5,nPos-5);
 
   if (sUrl == undefined)
     sUrl=baseUrl + '/opac/noticeajax/'+ sType;
@@ -109,7 +109,7 @@ function infos_bloc(sIdBloc,sIsbn,sType,sCherche,nNiveau,nPage, sUrl) {
 
   if(sCherche) sUrl = sUrl + '&cherche=' + sCherche;
 
-  var bloc = $('#'+sIdBloc + '_contenu');
+
   var width = bloc.width();
   sUrl = sUrl + '&width='+width;
 
-- 
GitLab