Skip to content

Commit

Permalink
Sliding now triggers goToRevision.
Browse files Browse the repository at this point in the history
  • Loading branch information
s1341 committed Dec 17, 2013
1 parent 676ff3f commit b8591ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/static/js/broadcast_slider.js
Expand Up @@ -58,6 +58,7 @@ $.Class("RevisionSlider",
},
onSlide: function (value) {
console.log("in slide handler:", value);
this.goToRevision(value);
},
loadElements: function (root_element) {
this.elements.root = root_element;
Expand Down
4 changes: 3 additions & 1 deletion src/static/js/sliderui.js
Expand Up @@ -136,14 +136,16 @@ $.Class("SliderUI",
if (_this.current_value != start_value) {
//_this.setValue(start_value);
}
var prev_value = start_value;

$(document).on("mousemove.slider", function (event) {
var current_value = Math.floor((event.clientX-_this.element.offset().left) / _this._getStep());
console.log("sliderbar mousemove, value:", current_value);
// don't change the value if it hasn't actually changed!
if (_this.current_value != current_value) {
if (prev_value != current_value) {
//_this.setValue(current_value);
_this._trigger("slide", current_value);
prev_value = current_value;
}
});

Expand Down

0 comments on commit b8591ed

Please sign in to comment.