fixed a couple show-stoppers. popcorn-port
authorhamidouk
Fri, 16 Dec 2011 18:16:23 +0100
branchpopcorn-port
changeset 474 c1998d5d552e
parent 473 1a09ab7e7163
child 475 5c254621cd9c
fixed a couple show-stoppers.
src/js/widgets/segmentsWidget.js
src/js/widgets/tooltipWidget.js
src/templates/overlay_marker.html
--- a/src/js/widgets/segmentsWidget.js	Fri Dec 16 16:23:59 2011 +0100
+++ b/src/js/widgets/segmentsWidget.js	Fri Dec 16 18:16:23 2011 +0100
@@ -63,7 +63,7 @@
     /* some sort of collapsing occurs, so we only have to substract one pixel to each box instead of
        two
     */
-    var endPourcent 	= IriSP.timeToPourcent(end, duration) - startPourcent - onePxPercent * 1;
+    var endPourcent 	= IriSP.timeToPourcent(end, duration) - startPourcent - onePxPercent * 1.5;
     
     /* on the other hand, we have to substract one pixel from the first box because it's the only
        one to have to effective 1px margins */
@@ -72,7 +72,7 @@
       endPourcent -= onePxPercent;
     }
     
-    var divTitle = annotation.content.title.substr(0,55);
+    var divTitle = (annotation.content.title + " - " + annotation.content.description).substr(0,55);
 
     if (typeof(annotation.content.color) !== "undefined")
       var color = annotation.content.color;
@@ -80,7 +80,7 @@
       var color = annotation.color;
     
     var hexa_color = IriSP.DEC_HEXA_COLOR(color);
-    console.log(hexa_color);
+    
     if (hexa_color === "FFCC00")
       hexa_color = "333";
     
@@ -111,7 +111,7 @@
           var offset_x = offset.left + correction - 106;
           if (offset_x < 0)
             offset_x = 0;
-
+                    
           self.TooltipWidget.show(divTitle, color, offset_x, event.pageY - 160);
     } })(divTitle)).mouseout(function(){
       IriSP.jQuery(this).animate({opacity: 0.3}, 5);
--- a/src/js/widgets/tooltipWidget.js	Fri Dec 16 16:23:59 2011 +0100
+++ b/src/js/widgets/tooltipWidget.js	Fri Dec 16 18:16:23 2011 +0100
@@ -1,6 +1,7 @@
 /* this widget displays a small tooltip */
 IriSP.TooltipWidget = function(Popcorn, config, Serializer) {
   IriSP.Widget.call(this, Popcorn, config, Serializer);
+  this._shown = false;
 };
 
 
@@ -19,15 +20,19 @@
 };
 
 IriSP.TooltipWidget.prototype.show = function(text, color, x, y) {
-  if (this.selector.find(".tiptext").text() == text)
+  if (this._shown === true || this.selector.find(".tiptext").text() == text)
     return;
 
   this.selector.find(".tipcolor").css("background-color", color);
 	this.selector.find(".tiptext").text(text);
   this.selector.find(".tip").css("left", x).css("top", y);
+  
+  this._shown = true;
 };
 
 IriSP.TooltipWidget.prototype.hide = function() {
   this.clear();
   this.selector.find(".tip").css("left", -10000).css("top", -100000);
+  
+  this._shown = false;
 };
--- a/src/templates/overlay_marker.html	Fri Dec 16 16:23:59 2011 +0100
+++ b/src/templates/overlay_marker.html	Fri Dec 16 18:16:23 2011 +0100
@@ -1,3 +1,3 @@
 {{! the template for the small white bars which is z-indexed over our segment widget }}
-<div class='positionMarker'>
+<div class='positionMarker' style='background-color: #F7268E;'>
 </div>
\ No newline at end of file