fixes for stemma retrieval and for relative paths in JS
[scpubgit/stemmatology.git] / stemmaweb / root / js / componentload.js
index c233b15..8db28dd 100644 (file)
@@ -1,6 +1,9 @@
 function loadTradition( textid ) {
     // First insert the placeholder image
     var basepath = window.location.pathname
+    if( basepath.lastIndexOf('/') == basepath.length - 1 ) { 
+       basepath = basepath.slice( 0, basepath.length - 1) 
+    };
     var imghtml = '<img src="' + basepath + '/images/ajax-loader.gif" alt="Loading SVG..."/>'
     $('#stemma_graph').empty();
     $('#variant_graph').empty();