my( $self, $c ) = @_;
my $tradition = delete $c->stash->{'tradition'};
my $collation = $tradition->collation;
-
+
+ # Stash text direction to use in JS.
+ $c->stash->{'direction'} = $collation->direction;
+
# Stash the relationship definitions
$c->stash->{'relationship_scopes'} =
to_json( find_type_constraint( 'RelationshipScope' )->values );
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) {
//initialize marquee
marquee = new Marquee();
-
+
+ if (text_direction == 'RL') {
+ scrollToEnd();
+ }
}
function add_relations( callback_fn ) {
return false;
}
+function scrollToEnd() {
+ var stateTf = svg_root_element.getCTM().inverse();
+
+ var vbdim = svg_root.viewBox.baseVal;
+ var width = Math.floor(svg_root_element.getBoundingClientRect().width) - vbdim.width;
+
+ var p = svg_root.createSVGPoint();
+ p.x = width;
+ p.y = 0;
+ p = p.matrixTransform(stateTf);
+
+ var matrix = stateTf.inverse().translate(-p.x, -100);
+ var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")";
+ svg_root_element.setAttribute("transform", s);
+}
$(document).ready(function () {
});
}
-function loadSVG(svgData) {
+function loadSVG(svgData, direction) {
+ text_direction = direction;
+
var svgElement = $('#svgenlargement');
$(svgElement).svg('destroy');