Added todos.
[scpubgit/stemmatology.git] / stemmaweb / root / js / componentload.js
CommitLineData
cf9626aa 1function loadTradition( textid ) {
e2f647b9 2
3 // TODO: scale #stemma_grpah both horizontally and vertically
4 // TODO: load svgs from SVG.Jquery (to make scaling react in Safari)
a88e75b1 5 $('#stemma_graph').load( "stemma/" + textid , function() {
6 var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root();
e2f647b9 7 console.log( stemma_svg_element );
a88e75b1 8 stemma_svg_element.height.baseVal.value = $('#stemma_graph').height();
9 });
10 $('#variant_graph').load( "variantgraph/" + textid , function() {
11 var variant_svg_element = $('#variant_graph svg').svg().svg('get').root();
12 var svg_height = variant_svg_element.height.baseVal.value;
13 var svg_width = variant_svg_element.width.baseVal.value;
14 var container_height = $('#variant_graph').height();
15 variant_svg_element.height.baseVal.value = container_height;
16 variant_svg_element.width.baseVal.value = (svg_width/svg_height * container_height);
17 });
18}