mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-28 19:29:15 -04:00
Sliding now triggers goToRevision.
This commit is contained in:
parent
676ff3f436
commit
b8591edc8d
2 changed files with 4 additions and 1 deletions
|
@ -58,6 +58,7 @@ $.Class("RevisionSlider",
|
||||||
},
|
},
|
||||||
onSlide: function (value) {
|
onSlide: function (value) {
|
||||||
console.log("in slide handler:", value);
|
console.log("in slide handler:", value);
|
||||||
|
this.goToRevision(value);
|
||||||
},
|
},
|
||||||
loadElements: function (root_element) {
|
loadElements: function (root_element) {
|
||||||
this.elements.root = root_element;
|
this.elements.root = root_element;
|
||||||
|
|
|
@ -136,14 +136,16 @@ $.Class("SliderUI",
|
||||||
if (_this.current_value != start_value) {
|
if (_this.current_value != start_value) {
|
||||||
//_this.setValue(start_value);
|
//_this.setValue(start_value);
|
||||||
}
|
}
|
||||||
|
var prev_value = start_value;
|
||||||
|
|
||||||
$(document).on("mousemove.slider", function (event) {
|
$(document).on("mousemove.slider", function (event) {
|
||||||
var current_value = Math.floor((event.clientX-_this.element.offset().left) / _this._getStep());
|
var current_value = Math.floor((event.clientX-_this.element.offset().left) / _this._getStep());
|
||||||
console.log("sliderbar mousemove, value:", current_value);
|
console.log("sliderbar mousemove, value:", current_value);
|
||||||
// don't change the value if it hasn't actually changed!
|
// 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.setValue(current_value);
|
||||||
_this._trigger("slide", current_value);
|
_this._trigger("slide", current_value);
|
||||||
|
prev_value = current_value;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue