Skip to content
Snippets Groups Projects
Commit 3653bb6f authored by Demian Katz's avatar Demian Katz Committed by GitHub
Browse files

Fixed noajax handling for embedded records. (#800)

parent d1768637
No related merge requests found
...@@ -38,8 +38,14 @@ VuFind.register('embedded', function embedded() { ...@@ -38,8 +38,14 @@ VuFind.register('embedded', function embedded() {
var id = $result.find('.hiddenId')[0].value; var id = $result.find('.hiddenId')[0].value;
var source = $result.find('.hiddenSource')[0].value; var source = $result.find('.hiddenSource')[0].value;
if ($tab.parent().hasClass('noajax')) { if ($tab.parent().hasClass('noajax')) {
window.location.href = $tab.attr('href'); if ($tab.is('a')) {
return true; // tab case:
window.location.href = $tab.attr('href');
} else {
// accordion case:
window.location.href = $tab.find('a').attr('data-href');
}
return false;
} }
var urlroot; var urlroot;
if (source === VuFind.defaultSearchBackend) { if (source === VuFind.defaultSearchBackend) {
...@@ -144,12 +150,11 @@ VuFind.register('embedded', function embedded() { ...@@ -144,12 +150,11 @@ VuFind.register('embedded', function embedded() {
} }
// Bind tab clicks // Bind tab clicks
longNode.find('.list-tab-toggle').click(function embeddedTabLoad() { 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); 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( longNode.find('[id^=usercomment]').find('input[type=submit]').unbind('click').click(
function embeddedComments() { function embeddedComments() {
return registerAjaxCommentRecord( return registerAjaxCommentRecord(
......
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