diff --git a/themes/bootstrap3/js/embedded_record.js b/themes/bootstrap3/js/embedded_record.js index 0d4eeb028ebe7cb7ec5e43508dadd1ce8a8346a9..e4543804e8b490514797a3cfb03e376050e5e2f3 100644 --- a/themes/bootstrap3/js/embedded_record.js +++ b/themes/bootstrap3/js/embedded_record.js @@ -38,8 +38,14 @@ VuFind.register('embedded', function embedded() { var id = $result.find('.hiddenId')[0].value; var source = $result.find('.hiddenSource')[0].value; if ($tab.parent().hasClass('noajax')) { - window.location.href = $tab.attr('href'); - return true; + if ($tab.is('a')) { + // tab case: + window.location.href = $tab.attr('href'); + } else { + // accordion case: + window.location.href = $tab.find('a').attr('data-href'); + } + return false; } var urlroot; if (source === VuFind.defaultSearchBackend) { @@ -144,12 +150,11 @@ VuFind.register('embedded', function embedded() { } // Bind tab clicks longNode.find('.list-tab-toggle').click(function embeddedTabLoad() { - addToStorage(divID, this.id); + if (!$(this).parent().hasClass('noajax')) { + addToStorage(divID, this.id); + } return ajaxLoadTab(this.id); }); - longNode.find('.noajax .list-tab-toggle').click(function accordionNoAjax() { - window.location.href = $(this).attr('data-href'); - }); longNode.find('[id^=usercomment]').find('input[type=submit]').unbind('click').click( function embeddedComments() { return registerAjaxCommentRecord(