From: Tara L Andrews Date: Thu, 4 Oct 2012 04:22:42 +0000 (+0200) Subject: add actual descriptions to tooltips; add tooltips to readonly.js X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=671c04b125f914f446f172554046639e3ece2f2d;p=scpubgit%2Fstemmaweb.git add actual descriptions to tooltips; add tooltips to readonly.js --- diff --git a/root/js/relationship-full.js b/root/js/relationship-full.js index e4b1c9c..923922b 100644 --- a/root/js/relationship-full.js +++ b/root/js/relationship-full.js @@ -202,11 +202,11 @@ function svgEnlargementLoaded() { function add_relations( callback_fn ) { // Add the relationship types to the keymap list - // TODO Make the descriptions (in typedef.description) available somewhere $.each( relationship_types, function(index, typedef) { - var elid = 'list_rel_' + typedef.name; - li_elm = $('
  • ').attr( 'id', elid ).css( "border-color", relation_manager.relation_colors[index] ).text(typedef.name); - li_elm.append( $('
    Some obligatory help txt would be going here.
    ') ); + li_elm = $('
  • ').css( "border-color", + relation_manager.relation_colors[index] ).text(typedef.name); + li_elm.append( $('
    ').attr('class', 'key_tip_container').append( + $('
    ').attr('class', 'key_tip').text(typedef.description) ) ); $('#keymaplist').append( li_elm ); }); // Now fetch the relationships themselves and add them to the graph diff --git a/root/js/relationship-readonly.js b/root/js/relationship-readonly.js index b328972..bfb62c7 100644 --- a/root/js/relationship-readonly.js +++ b/root/js/relationship-readonly.js @@ -201,8 +201,11 @@ function svgEnlargementLoaded() { function add_relations( callback_fn ) { // Add the relationship types to the keymap list $.each( relationship_types, function(index, typedef) { - var elid = 'list_rel_' + typedef.name; - $('#keymaplist').append( $('
  • ').attr( 'id', elid ).css( "border-color", relation_manager.relation_colors[index] ).text(typedef.name) ); + li_elm = $('
  • ').css( "border-color", + relation_manager.relation_colors[index] ).text(typedef.name); + li_elm.append( $('
    ').attr('class', 'key_tip_container').append( + $('
    ').attr('class', 'key_tip').text(typedef.description) ) ); + $('#keymaplist').append( li_elm ); }); // Now fetch the relationships themselves and add them to the graph var rel_types = $.map( relationship_types, function(t) { return t.name });