From: tla Date: Thu, 18 Jun 2015 12:00:16 +0000 (+0200) Subject: Minor fixes to pull request #58 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=aeb47ed3252cdb2193217544611ca4788ca4d7c1;p=scpubgit%2Fstemmaweb.git Minor fixes to pull request #58 --- diff --git a/lib/stemmaweb/Controller/Relation.pm b/lib/stemmaweb/Controller/Relation.pm index 12c63ef..3127298 100644 --- a/lib/stemmaweb/Controller/Relation.pm +++ b/lib/stemmaweb/Controller/Relation.pm @@ -71,7 +71,7 @@ sub main :Chained('text') :PathPart('') :Args(0) { my $collation = $tradition->collation; # Stash text direction to use in JS. - $c->stash->{'direction'} = $collation->direction; + $c->stash->{'direction'} = $collation->direction || 'BI'; # Stash the relationship definitions $c->stash->{'relationship_scopes'} = @@ -522,10 +522,6 @@ sub compress :Chained('text') :PathPart :Args(0) { $m->save($collation); - if ($collation->direction eq 'RL') { - @nodes = reverse @nodes; - } - $c->stash->{'result'} = { success => 1, nodes => \@nodes, diff --git a/root/js/relationship.js b/root/js/relationship.js index 79162d9..fe9f624 100644 --- a/root/js/relationship.js +++ b/root/js/relationship.js @@ -4,7 +4,6 @@ var svg_root_element = null; var start_element_height = 0; var reltypes = {}; var readingdata = {}; -var text_direction = 'LR'; jQuery.removeFromArray = function(value, arr) { return jQuery.grep(arr, function(elem, index) { @@ -1607,9 +1606,7 @@ function expandFillPageClients() { }); } -function loadSVG(svgData, direction) { - text_direction = direction; - +function loadSVG(svgData) { var svgElement = $('#svgenlargement'); $(svgElement).svg('destroy'); diff --git a/root/src/relate.tt b/root/src/relate.tt index 016ae38..fb15ab9 100644 --- a/root/src/relate.tt +++ b/root/src/relate.tt @@ -9,6 +9,7 @@ var basepath = "[% c.uri_for( '/relation/' ) %]"; var textid = "[% textid %]"; var can_morphologize = "[% can_morphologize %]"; var editable = "[% permission %]" === "full"; +var text_direction = "[% direction %]"; // URLs for images referenced in Javascript var merge_button_yes = "[% c.uri_for( '/images/tick_circle_frame.png' ) %]"; var merge_button_no = "[% c.uri_for( '/images/no_entry.png' ) %]"; @@ -24,7 +25,7 @@ var ternary_values = [% ternary_values %]; [% END -%] $(document).ready(function () { - loadSVG('[% svg_string %]', '[% direction %]'); + loadSVG('[% svg_string %]'); }); [% END %]