properly disable OK button
[scpubgit/stemmatology.git] / stemmaweb / root / js / componentload.js
index e8003a3..e881f84 100644 (file)
@@ -1,4 +1,4 @@
-function loadTradition( textid ) {
+function loadTradition( textid, textname ) {
     // First insert the placeholder image
     var basepath = window.location.pathname
     if( basepath.lastIndexOf('/') == basepath.length - 1 ) { 
@@ -12,12 +12,7 @@ function loadTradition( textid ) {
     // Then get and load the actual content.
     // TODO: scale #stemma_grpah both horizontally and vertically
     // TODO: load svgs from SVG.Jquery (to make scaling react in Safari)
-       $('#stemma_graph').load( basepath + "/stemma/" + textid , function() {
-           if( $('#stemma_graph svg').size() != 0 ) {
-               var stemma_svg_element = $('#stemma_graph svg').svg().svg('get').root();
-               stemma_svg_element.height.baseVal.value = $('#stemma_graph').height();
-       }
-       });
+       $('#stemma_graph').load( basepath + "/stemma/" + textid );
     $('#variant_graph').load( basepath + "/variantgraph/" + textid , function() {
        var variant_svg_element = $('#variant_graph svg').svg().svg('get').root();
        var svg_height = variant_svg_element.height.baseVal.value;
@@ -26,4 +21,13 @@ function loadTradition( textid ) {
        variant_svg_element.height.baseVal.value = container_height;
        variant_svg_element.width.baseVal.value = (svg_width/svg_height * container_height);
        });
+       
+       // Then populate the various elements with the right text name/ID.
+       // Stemma and variant graph titles
+       $('.texttitle').empty();
+       $('.texttitle').append( textname );
+       // Stexaminer submit action
+       $('#run_stexaminer').attr( 'action', basepath + "/stexaminer/" + textid );
+       // Relationship mapper submit action
+       $('#run_relater').attr( 'action', basepath + "/relation/" + textid );
 }