Commit 9281058b authored by Patrick Barroca's avatar Patrick Barroca 🎮

Merge branch 'hotline#87884_ebooks_ressource_non_disponible' into 'hotline'

hotline#87884 : added and error message on bloc or tab loading in view notice

See merge request afi/opacce!3113
parents db38132f c56fc1f1
- ticket #87884 : Vue notice : Ajout d'un message d'erreur lorsque le chargement d'un bloc ou d'un onglet échoue
\ No newline at end of file
......@@ -51,7 +51,6 @@ function getNoticeAjax(sIdNotice,sContainer,sTypeDoc)
///////////////////////////////////////////////////////////////////////////////////
function infos_onglet(sIdOngletCourant,sIsbn,sType,sCherche,nNiveau,nPage,sUrl)
{
$('.onglet_select').attr('className','onglet').removeClass('onglet_select');
$('#'+sIdOngletCourant).attr('className','onglet_select').addClass('onglet_select');
$('div.onglet').css('display','none');
......@@ -71,11 +70,8 @@ function infos_onglet(sIdOngletCourant,sIsbn,sType,sCherche,nNiveau,nPage,sUrl)
var onglet = $('#' + sIdOngletCourant +'_contenu');
onglet
.css('display','block')
.css('max-width', onglet.parent().width()+'px')
.load(sUrl, function() {
initializePopups();
blocNoticeAfterLoad(sType, sIsbn, onglet);
});
.css('max-width', onglet.parent().width()+'px');
loadAjaxOrShowError(onglet, sUrl, sIsbn, sType);
}
......@@ -113,12 +109,19 @@ function infos_bloc(sIdBloc,sIsbn,sType,sCherche,nNiveau,nPage, sUrl) {
var width = bloc.width();
sUrl = sUrl + '&width='+width;
bloc
.css('max-width', width+'px')
.load(sUrl, function() {
bloc.css('max-width', width+'px');
loadAjaxOrShowError(bloc, sUrl, sIsbn, sType);
}
function loadAjaxOrShowError(node, url, isbn, type) {
node.load(url, function(textResponse, textStatus) {
if (textStatus == 'success') {
initializePopups();
blocNoticeAfterLoad(sType, sIsbn, bloc);
});
blocNoticeAfterLoad(type, isbn, node);
return;
}
$(this).html('<div class="error">Une erreur s\'est produite au chargement du contenu</div>');
});
}
function fermer_infos_notice(sId)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment