From: Tara L Andrews Date: Thu, 2 Feb 2012 23:41:12 +0000 (+0100) Subject: fixes for stemma retrieval and for relative paths in JS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2Fstemmatology.git;a=commitdiff_plain;h=3e420a82df2d51189dd4d491f0470b59b3b8dcfb fixes for stemma retrieval and for relative paths in JS --- diff --git a/stemmaweb/lib/stemmaweb/Controller/Root.pm b/stemmaweb/lib/stemmaweb/Controller/Root.pm index 4b4e5e8..de51958 100644 --- a/stemmaweb/lib/stemmaweb/Controller/Root.pm +++ b/stemmaweb/lib/stemmaweb/Controller/Root.pm @@ -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'); } diff --git a/stemmaweb/root/js/componentload.js b/stemmaweb/root/js/componentload.js index c233b15..8db28dd 100644 --- a/stemmaweb/root/js/componentload.js +++ b/stemmaweb/root/js/componentload.js @@ -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 = 'Loading SVG...' $('#stemma_graph').empty(); $('#variant_graph').empty();