Added in the NumberControllerSlider a reference to the NumberControllerBox associated, to fix the displayed value precision bug for sliders when step is defined afterwards (via step() method instead of as option in add() method)

This commit is contained in:
Vousk-prod 2015-11-05 23:00:09 +01:00
parent 8f0eba8ade
commit 689560b142
2 changed files with 7 additions and 0 deletions

View File

@ -124,6 +124,11 @@ define([
this.__step = v; this.__step = v;
this.__impliedStep = v; this.__impliedStep = v;
this.__precision = numDecimals(v); this.__precision = numDecimals(v);
if (this.__valueControllerBox !== undefined) {
this.__valueControllerBox.__step = this.__step;
this.__valueControllerBox.__impliedStep = this.__impliedStep;
this.__valueControllerBox.__precision = this.__precision;
}
return this; return this;
} }

View File

@ -927,6 +927,8 @@ define([
var box = new NumberControllerBox(controller.object, controller.property, var box = new NumberControllerBox(controller.object, controller.property,
{ min: controller.__min, max: controller.__max, step: controller.__step }); { min: controller.__min, max: controller.__max, step: controller.__step });
controller.__valueControllerBox = box;
common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) { common.each(['updateDisplay', 'onChange', 'onFinishChange'], function(method) {
var pc = controller[method]; var pc = controller[method];
var pb = box[method]; var pb = box[method];