From: Tara L Andrews Date: Sun, 30 Sep 2012 03:13:21 +0000 (+0200) Subject: update relation mapper to use base stemmatology lib as of commit 9e9b754 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8073db65f137e4c3a11fab0ff26fabba2bf2ed35;p=scpubgit%2Fstemmaweb.git update relation mapper to use base stemmatology lib as of commit 9e9b754 --- diff --git a/lib/stemmaweb/Controller/Relation.pm b/lib/stemmaweb/Controller/Relation.pm index 7e537d9..8187847 100644 --- a/lib/stemmaweb/Controller/Relation.pm +++ b/lib/stemmaweb/Controller/Relation.pm @@ -224,8 +224,8 @@ sub relationships :Chained('text') :PathPart :Args(0) { my $note = $c->request->param('note'); my $scope = $c->request->param('scope'); - my $opts = { 'type' => $relation, - 'scope' => $scope }; + my $opts = { 'type' => $relation, 'propagate' => 1 }; + $opts->{'scope'} = $scope if $scope; $opts->{'annotation'} = $note if $note; try { diff --git a/root/js/relationship-full.js b/root/js/relationship-full.js index 7847571..20424db 100644 --- a/root/js/relationship-full.js +++ b/root/js/relationship-full.js @@ -638,7 +638,8 @@ $(document).ready(function () { $.each( data, function(item, source_target) { var source_found = get_ellipse( source_target[0] ); var target_found = get_ellipse( source_target[1] ); - if( source_found.size() && target_found.size() ) { + var relation_found = $.inArray( source_target[2], rel_types ); + if( source_found.size() && target_found.size() && relation_found > -1 ) { var relation = relation_manager.create( source_target[0], source_target[1], $('#rel_type')[0].selectedIndex-1 ); relation.data( 'type', $('#rel_type :selected').text() ); relation.data( 'scope', $('#scope :selected').text() );