some style modifications
[scpubgit/stemmatology.git] / stemmaweb / root / js / stexaminer.js
CommitLineData
81422c40 1var colors = ['#ffeeaa','#afc6e9','#d5fff6','#ffccaa','#ffaaaa','#e5ff80','#e5d5ff','#ffd5e5'];
361134f0 2var row_triggered = false;
ce14597f 3$(document).ready(function() {
4 $('.rowid').click( function() {
361134f0 5 row_triggered = true;
82fd8e05 6 $('ellipse').attr( {stroke:'black', fill:'#fff'} );
119157ee 7 $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} );
8 $('.node').children('text').attr( {stroke:'none', fill:'#000'} );
d5c17cec 9 $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7');
ce14597f 10 $(this).parent().nextAll('.clickable').children('span').click();
d5c17cec 11 $('td.active_variant_cell').removeClass('active_variant_cell');
361134f0 12 row_triggered = false;
ce14597f 13 });
5b89f7ce 14 $('svg').width('485px');
ce14597f 15})
82fd8e05 16function color_nodes( column_index, arr_node_ids, arr_greynode_ids ) {
d5c17cec 17 if( !row_triggered ) {
18 $('tr.active_variant_row').children('td').removeClass('cellb0 cellb1 cellb2 cellb3 cellb4 cellb5 cellb6 cellb7');
19 $('td.active_variant_cell').removeClass('active_variant_cell');
20 $('ellipse').attr( {stroke:'black', fill:'#fff'} );
119157ee 21 $('.node').children('polygon').attr( {stroke:'#fff', fill:'#fff'} );
22 $('.node').children('text').attr( {stroke:'none', fill:'#000'} );
82fd8e05 23 };
d5c17cec 24 $('tr.active_variant_row').removeClass('active_variant_row')
82fd8e05 25 jQuery.each( arr_greynode_ids, function(index,value) {
119157ee 26 nodes = $('.node').children('title').filter( function(index) {
82fd8e05 27 return $(this).text() == value;
119157ee 28 })
29 nodes.siblings('ellipse, polygon, text').each( function( index ) {
30 $(this).attr( {stroke:'#ddd', fill:'#f8f8f8'} );
82fd8e05 31 });
32 });
dbcf12a6 33 jQuery.each( arr_node_ids, function(index,value) {
34 $('.node').children('title').filter( function(index) {
35 return $(this).text() == value;
94a077d6 36 }).siblings('ellipse').each( function( index ) {
361134f0 37 $(this).attr( {stroke:'black', fill:colors[column_index-1]} );
38 });
dbcf12a6 39 });
40}