fixes for stemma retrieval and for relative paths in JS
Tara L Andrews [Thu, 2 Feb 2012 23:41:12 +0000 (00:41 +0100)]
stemmaweb/lib/stemmaweb/Controller/Root.pm
stemmaweb/root/js/componentload.js

index 4b4e5e8..de51958 100644 (file)
@@ -128,8 +128,8 @@ sub stemma :Local :Args(1) {
                $m->store( $tradition );
        }
        
-       $c->stash->{'result'} = $tradition->stemma
-               ? $tradition->stemma->as_svg
+       $c->stash->{'result'} = $tradition->stemma_count
+               ? $tradition->stemma(0)->as_svg
                : '';
        $c->forward('View::SVG');
 }
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();