src/widgets/Annotation.js
changeset 1004 cf0f2339169e
parent 1002 a86208b60c91
child 1007 639129cf95bc
--- a/src/widgets/Annotation.js	Wed Jun 19 18:54:46 2013 +0200
+++ b/src/widgets/Annotation.js	Wed Jul 03 17:04:43 2013 +0200
@@ -48,6 +48,7 @@
     annotation_type : "chap",
     start_minimized: false,
     show_arrow : true,
+    arrow_position: .5,
     site_name : "Lignes de Temps",
     search_on_tag_click: true,
     show_social: true,
@@ -140,7 +141,7 @@
         _this.$.find(".Ldt-Annotation-Inner").removeClass("Ldt-Annotation-Empty");
         _this.bounds = [ _annotation.begin, _annotation.end ];
         if (_this.arrow) {
-            _this.arrow.moveToTime((_annotation.begin + _annotation.end)/2);
+            _this.arrow.moveToTime((1 - _this.arrow_position) * _annotation.begin + _this.arrow_position * _annotation.end);
         }
         _this.sendBounds();
     }
@@ -151,7 +152,9 @@
         this.insertSubwidget(this.$.find(".Ldt-Annotation-Social"), { type: "Social" }, "socialWidget");
     }
     
-    this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"), { type: "Arrow", width: this.width }, "arrow");
+    if (this.show_arrow) {
+        this.insertSubwidget(this.$.find(".Ldt-Annotation-Arrow"), { type: "Arrow", width: this.width }, "arrow");
+    }
     this.onMediaEvent("timeupdate",timeupdate);
     this.onMdpEvent("Annotation.hide","hide");
     this.onMdpEvent("Annotation.show","show");