src/js/widgets/arrowWidget.js
author hamidouk
Wed, 23 Nov 2011 11:14:01 +0100
branchpopcorn-port
changeset 305 e8d05c3f77ed
parent 299 d2005f747d5a
child 313 7df805ebb75e
permissions -rw-r--r--
created an arrow widget.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
299
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     1
IriSP.ArrowWidget = function(Popcorn, config, Serializer) {
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     2
  IriSP.Widget.call(this, Popcorn, config, Serializer);
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     3
  
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     4
};
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     5
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     6
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     7
IriSP.ArrowWidget.prototype = new IriSP.Widget();
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     8
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
     9
IriSP.ArrowWidget.prototype.clear = function() {
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    10
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    11
};
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    12
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    13
IriSP.ArrowWidget.prototype.clearWidget = function() {
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    14
};
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    15
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    16
IriSP.ArrowWidget.prototype.draw = function() {
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    17
  var templ = Mustache.to_html(IriSP.arrowWidget_template, {});
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    18
  this.selector.append(templ);
305
e8d05c3f77ed created an arrow widget.
hamidouk
parents: 299
diff changeset
    19
  this._Popcorn.listen("IriSP.SegmentsWidget.segmentClick", IriSP.wrap(this, this.segmentClickHandler));
299
d2005f747d5a added a new widget, the arrowWidget.
hamidouk
parents:
diff changeset
    20
};
305
e8d05c3f77ed created an arrow widget.
hamidouk
parents: 299
diff changeset
    21
e8d05c3f77ed created an arrow widget.
hamidouk
parents: 299
diff changeset
    22
IriSP.ArrowWidget.prototype.segmentClickHandler = function(percents) {
e8d05c3f77ed created an arrow widget.
hamidouk
parents: 299
diff changeset
    23
 this.selector.children(".Ldt-arrowWidget").css("left", percents + "%");
e8d05c3f77ed created an arrow widget.
hamidouk
parents: 299
diff changeset
    24
}