From: Tara L Andrews Date: Fri, 3 Feb 2012 21:35:55 +0000 (+0100) Subject: pull changes from lemmatizer X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=af9c16ef22c2bc0560d2ed4807237a8710dea7bf;p=scpubgit%2Fstemmatology.git pull changes from lemmatizer --- diff --git a/stemmaweb/root/js/relationship.js b/stemmaweb/root/js/relationship.js index 608d1ed..b615f5a 100644 --- a/stemmaweb/root/js/relationship.js +++ b/stemmaweb/root/js/relationship.js @@ -54,10 +54,7 @@ function add_relations() { $.each(data, function( index, rel_info ) { var type_index = $.inArray(rel_info.type, rel_types); if( type_index != -1 ) { - console.log( 'drawing' ); relation_manager.create( rel_info.source, rel_info.target, type_index ); - } else { - console.log( 'not drawing' ); } }) }); @@ -118,8 +115,11 @@ function node_obj(ellipse) { } this.mousemove_listener = function(evt) { - self.dx = (evt.clientX - self.x) / mousemove_enlargement_ratio; - self.dy = (evt.clientY - self.y) / mousemove_enlargement_ratio; + // magnification on workspace lock temporarily disabled + // self.dx = (evt.clientX - self.x) / mousemove_enlargement_ratio; + // self.dy = (evt.clientY - self.y) / mousemove_enlargement_ratio; + self.dx = (evt.clientX - self.x) / scroll_enlargement_ratio; + self.dy = (evt.clientY - self.y) / scroll_enlargement_ratio; self.move_elements(); } @@ -429,8 +429,9 @@ $(document).ready(function () { ellipse.data( 'node_obj' ).set_draggable( false ); ellipse.data( 'node_obj', null ); }) - svg_enlargement.children[0].setAttribute( 'transform', $(this).data('transform_memo') ); - $('#enlargement').scrollLeft( $(this).data('scrollleft_memo') ); + // magnification on workspace lock temporarily disabled + // svg_enlargement.children[0].setAttribute( 'transform', $(this).data('transform_memo') ); + // $('#enlargement').scrollLeft( $(this).data('scrollleft_memo') ); $(this).data('locked', false); $(this).css('background-position', '0px 0px'); } else { @@ -449,22 +450,23 @@ $(document).ready(function () { } ellipse.data( 'node_obj' ).greyout_edges(); }) - var graph_frag_height = y_max - y_min ; - var svg_enlargement_vbheight = svg_enlargement.viewBox.baseVal.height; - var svg_enlargement_vbwidth = svg_enlargement.viewBox.baseVal.width; - var scale = svg_enlargement_vbheight / graph_frag_height; - mousemove_enlargement_ratio = scroll_enlargement_ratio * scale; - var scroll_padding = $('#enlargement_container').width(); - var scroll_scale = svg_enlargement_vbwidth / ( parseFloat( $('#svgenlargement svg').attr('width') ) - scroll_padding ); - var vbx_of_scroll = ( $('#enlargement').scrollLeft() ) * scroll_scale; - var translate_x = vbx_of_scroll; - var transform = svg_enlargement.children[0].getAttribute('transform'); - $(this).data('transform_memo', transform ); - $(this).data('scrollleft_memo', $('#enlargement').scrollLeft() ); + // magnification on workspace lock temporarily disabled + // var graph_frag_height = y_max - y_min ; + // var svg_enlargement_vbheight = svg_enlargement.viewBox.baseVal.height; + // var svg_enlargement_vbwidth = svg_enlargement.viewBox.baseVal.width; + // var scale = svg_enlargement_vbheight / graph_frag_height; + // mousemove_enlargement_ratio = scroll_enlargement_ratio * scale; + // var scroll_padding = $('#enlargement_container').width(); + // var scroll_scale = svg_enlargement_vbwidth / ( parseFloat( $('#svgenlargement svg').attr('width') ) - scroll_padding ); + // var vbx_of_scroll = ( $('#enlargement').scrollLeft() ) * scroll_scale; + // var translate_x = vbx_of_scroll; + // var transform = svg_enlargement.children[0].getAttribute('transform'); + // $(this).data('transform_memo', transform ); + // $(this).data('scrollleft_memo', $('#enlargement').scrollLeft() ); $(this).data('locked', true ); - $('#enlargement').scrollLeft(0); - transform = 'scale(' + scale + ') translate(' + (-1 * translate_x) + ',' + (-1 * y_min) + ')'; - svg_enlargement.children[0].setAttribute( 'transform', transform ); + // $('#enlargement').scrollLeft(0); + // transform = 'scale(' + scale + ') translate(' + (-1 * translate_x) + ',' + (-1 * y_min) + ')'; + // svg_enlargement.children[0].setAttribute( 'transform', transform ); } });