Include text direction as editable attribute of a tradition
[scpubgit/stemmaweb.git] / root / js / componentload.js
index 24b692b..60757c6 100644 (file)
@@ -274,6 +274,11 @@ function loadSVG(svgData) {
 
 function set_stemma_interactive( svg_element ) {
        if( selectedTextEditable ) {
+         // unbind is needed as this set_stemma_interactive is called each time
+         // the stemma is re-rooted, and each time jquery adds an 
+         // onclick handler to the root_tree_dialog_button_ok
+         // that all re-root the stemma, that all add an onclick, etc..
+         $( "#root_tree_dialog_button_ok" ).unbind();
                $( "#root_tree_dialog_button_ok" ).click( function() {
                        var requrl = _get_url([ "stemmaroot", selectedTextID, selectedStemmaID ]);
                        var targetnode = $('#root_tree_dialog').data( 'selectedNode' );
@@ -498,7 +503,7 @@ $(document).ready( function() {
                        $("#edit_textinfo_status").empty();
                        // Populate the form fields with the current values
                        // edit_(name, language, public, owner)
-                       $.each([ 'name', 'language', 'owner' ], function( idx, k ) {
+                       $.each([ 'name', 'language', 'owner', 'direction' ], function( idx, k ) {
                                var fname = '#edit_' + k;
                                // Special case: language Default is basically language null
                                if( k == 'language' && selectedTextInfo[k] == 'Default' ) {