Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slider not sending values #675

Merged
merged 3 commits into from
Oct 28, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions source/class/cv/ui/structure/pure/Slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ qx.Class.define('cv.ui.structure.pure.Slide', {
sendOnFinish: {
check: "Boolean",
init: false
},
inAction: {
check: "Boolean",
init: false
}
},

Expand Down Expand Up @@ -117,7 +113,7 @@ qx.Class.define('cv.ui.structure.pure.Slide', {
// set initial value
slider.setValue(parseFloat(this.getValue()));

slider.on("changeValue", qx.util.Function.throttle(this._onChangeValue, 250, true), this);
slider.on("changeValue", qx.util.Function.throttle(this._onChangeValue, 250), this);

this.addListener("changeValue", function (ev) {
slider.setValue(parseFloat(ev.getData()));
Expand Down Expand Up @@ -161,7 +157,7 @@ qx.Class.define('cv.ui.structure.pure.Slide', {
},

_update: function (ga, d) {
if (this.getInAction() || d === undefined) {
if ((this.__slider && this.__slider.isInPointerMove()) || d === undefined) {
return;
}
var value = this.applyTransform(ga, d);
Expand Down Expand Up @@ -193,7 +189,7 @@ qx.Class.define('cv.ui.structure.pure.Slide', {
var currentValue = this.getValue();
this.sendToBackend(value, function(addr) {
var newValue = cv.Transform.encode(addr[0], value);
return !isNaN(newValue) && newValue !== cv.Transform.encode(addr[0], currentValue);
return (newValue !== cv.Transform.encode(addr[0], currentValue));
});
}
this.setValue(value);
Expand Down