src/js/widgets/sliderWidget.js
branchpopcorn-port
changeset 316 3b11a798f5e4
parent 289 c0e399fbf3fb
child 322 6fc87426ecd4
equal deleted inserted replaced
315:4466bf448426 316:3b11a798f5e4
     5 IriSP.SliderWidget.prototype = new IriSP.Widget();
     5 IriSP.SliderWidget.prototype = new IriSP.Widget();
     6 
     6 
     7 IriSP.SliderWidget.prototype.draw = function() {
     7 IriSP.SliderWidget.prototype.draw = function() {
     8   var self = this;
     8   var self = this;
     9 
     9 
       
    10   this.selector.append(Mustache.to_html(IriSP.sliderWidget_template, {}));
    10 
    11 
    11   this.selector.append("<div class='sliderBackground'></div>");
    12   this.sliderBackground = this.selector.find(".Ldt-sliderBackground");
    12   this.sliderBackground = this.selector.find(".sliderBackground");
    13   this.sliderForeground = this.selector.find(".Ldt-sliderForeground");
    13 
    14   this.positionMarker = this.selector.find(".Ldt-sliderPositionMarker");
    14   this.selector.append("<div class='sliderForeground'></div>");
       
    15   this.sliderForeground = this.selector.find(".sliderForeground");
       
    16 
       
    17   this.selector.append(Mustache.to_html(IriSP.overlay_marker_template));
       
    18   this.positionMarker = this.selector.find(".positionMarker");
       
    19   this.positionMarker.css("height", "10px");
       
    20   this.positionMarker.css("width", "10px");
       
    21   this.positionMarker.css("top", "0%");
       
    22 
    15 
    23   // a special variable to stop methods from tinkering
    16   // a special variable to stop methods from tinkering
    24   // with the positionMarker when the user is dragging it
    17   // with the positionMarker when the user is dragging it
    25   this.draggingOngoing = false;
    18   this.draggingOngoing = false;
    26 
    19 
    67   this._Popcorn.currentTime(newTime);
    60   this._Popcorn.currentTime(newTime);
    68 };
    61 };
    69 
    62 
    70 /* handles mouse over the slider */
    63 /* handles mouse over the slider */
    71 IriSP.SliderWidget.prototype.mouseOverHandler = function(event) {
    64 IriSP.SliderWidget.prototype.mouseOverHandler = function(event) {
    72   this.sliderBackground.animate({"padding-top": "10px"}, 100);
    65 /*  this.sliderBackground.animate({"padding-top": "10px", "margin-top": "-10px"}, 100);
    73   this.sliderForeground.animate({"padding-top": "10px"}, 100);
    66   this.sliderForeground.animate({"margin-top": "-10px"}, 100); */
    74 };
    67 };
    75 
    68 
    76 /* handles when the mouse leaves the slider */
    69 /* handles when the mouse leaves the slider */
    77 IriSP.SliderWidget.prototype.mouseOutHandler = function(event) {
    70 IriSP.SliderWidget.prototype.mouseOutHandler = function(event) {
    78   this.sliderBackground.animate({"padding-top": "5px"}, 50);
    71 /*  this.sliderBackground.animate({"padding-top": "5", "margin-top": "0px"}, 100);
    79   this.sliderForeground.animate({"padding-top": "5px"}, 50);
    72   this.sliderForeground.animate({"padding-top": "5px"}, 50); */
    80 };
    73 };
    81 
    74 
    82 // called when the user starts dragging the position indicator
    75 // called when the user starts dragging the position indicator
    83 IriSP.SliderWidget.prototype.positionMarkerDraggingStartedHandler = function(event, ui) {
    76 IriSP.SliderWidget.prototype.positionMarkerDraggingStartedHandler = function(event, ui) {
    84   this.draggingOngoing = true;
    77   this.draggingOngoing = true;