From: Joris van Zundert Date: Mon, 15 Dec 2014 21:44:39 +0000 (+0100) Subject: Fixed recursively loading re-rooted stemma X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=54c050ab1db494fa4d8b24ce67bfb38ab14a25c0;p=scpubgit%2Fstemmaweb.git Fixed recursively loading re-rooted stemma --- diff --git a/root/js/componentload.js b/root/js/componentload.js index 24b692b..76fe2df 100644 --- a/root/js/componentload.js +++ b/root/js/componentload.js @@ -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' );