Skip to content
Snippets Groups Projects
Commit 2810ddc4 authored by Demian Katz's avatar Demian Katz
Browse files

Fixed AJAX tabs when VuFind is installed at site root.

- Resolves VUFIND-1138.
parent f57684e2
Branches
Tags
No related merge requests found
...@@ -156,9 +156,16 @@ function ajaxLoadTab(tabid, setHash) { ...@@ -156,9 +156,16 @@ function ajaxLoadTab(tabid, setHash) {
// Parse out the base URL for the current record: // Parse out the base URL for the current record:
var urlParts = document.URL.split(/[?#]/); var urlParts = document.URL.split(/[?#]/);
var urlWithoutFragment = urlParts[0]; var urlWithoutFragment = urlParts[0];
var pathInUrl = urlWithoutFragment.indexOf(path); if (path == '') {
var chunks = urlWithoutFragment.substring(pathInUrl + path.length + 1).split('/'); // special case -- VuFind installed at site root:
var urlroot = '/' + chunks[0] + '/' + chunks[1]; var chunks = urlWithoutFragment.split('/');
var urlroot = '/' + chunks[3] + '/' + chunks[4];
} else {
// standard case -- VuFind has its own path under site:
var pathInUrl = urlWithoutFragment.indexOf(path);
var chunks = urlWithoutFragment.substring(pathInUrl + path.length + 1).split('/');
var urlroot = '/' + chunks[0] + '/' + chunks[1];
}
// Request the tab via AJAX: // Request the tab via AJAX:
$.ajax({ $.ajax({
......
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