From: Tara L Andrews Date: Tue, 12 Nov 2013 12:09:54 +0000 (+0100) Subject: a better way to store the relevant root node; bump JS version number. #29 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f4b205a184a10db19f299f610d8589753cea233;p=scpubgit%2Fstemmaweb.git a better way to store the relevant root node; bump JS version number. #29 --- diff --git a/root/js/componentload.js b/root/js/componentload.js index 61ab006..3f2f264 100644 --- a/root/js/componentload.js +++ b/root/js/componentload.js @@ -232,13 +232,13 @@ function set_stemma_interactive( svg_element ) { if( selectedTextEditable ) { $( "#root_tree_dialog_button_ok" ).click( function() { var requrl = _get_url([ "stemmaroot", selectedTextID, selectedStemmaID ]); - var targetnode = $('ellipse.stemma_node_highlight').parent().attr('id'); + var targetnode = $('#root_tree_dialog').data( 'selectedNode' ); $.post( requrl, { root: targetnode }, function (data) { // Reload the new stemma stemmata[selectedStemmaID] = data; load_stemma( selectedStemmaID ); // Put away the dialog - $('#root_tree_dialog').hide(); + $('#root_tree_dialog').data( 'selectedNode', null ).hide(); } ); } ).ajaxError( function(event, jqXHR, ajaxSettings, thrownError) { if( ajaxSettings.url.indexOf( 'stemmaroot' ) > -1 @@ -254,12 +254,15 @@ function set_stemma_interactive( svg_element ) { if( typeof root_tree_dialog_timeout !== 'undefined' ) { clearTimeout( root_tree_dialog_timeout ) }; g.unbind( 'mouseleave' ); var dialog = $( '#root_tree_dialog' ); + // Note which node triggered the dialog + dialog.data( 'selectedNode', g.attr('id') ); + // Position the dialog dialog.hide(); dialog.css( 'top', evt.pageY + 3 ); dialog.css( 'left', evt.pageX + 3 ); dialog.show(); root_tree_dialog_timeout = setTimeout( function() { - $( '#root_tree_dialog' ).hide(); + $( '#root_tree_dialog' ).data( 'selectedNode', null ).hide(); ellipse.removeClass( 'stemma_node_highlight' ); g.mouseleave( function() { ellipse.removeClass( 'stemma_node_highlight' ) } ); }, 3000 ); diff --git a/root/src/header.tt b/root/src/header.tt index 1821de3..19422b6 100644 --- a/root/src/header.tt +++ b/root/src/header.tt @@ -1,4 +1,4 @@ -[% vstr = '001' -%] +[% vstr = '002' -%]