mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
#179 : Cannot update NumberControllerBox with .listen() fix
This commit is contained in:
parent
fe5bb21f59
commit
fa20388df9
@ -1175,6 +1175,9 @@ var NumberControllerBox = function (_NumberController) {
|
|||||||
createClass(NumberControllerBox, [{
|
createClass(NumberControllerBox, [{
|
||||||
key: 'updateDisplay',
|
key: 'updateDisplay',
|
||||||
value: function updateDisplay() {
|
value: function updateDisplay() {
|
||||||
|
if (this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||||
return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this);
|
return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this);
|
||||||
}
|
}
|
||||||
@ -1244,6 +1247,9 @@ var NumberControllerSlider = function (_NumberController) {
|
|||||||
createClass(NumberControllerSlider, [{
|
createClass(NumberControllerSlider, [{
|
||||||
key: 'updateDisplay',
|
key: 'updateDisplay',
|
||||||
value: function updateDisplay() {
|
value: function updateDisplay() {
|
||||||
|
if (this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
var pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
||||||
this.__foreground.style.width = pct * 100 + '%';
|
this.__foreground.style.width = pct * 100 + '%';
|
||||||
return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this);
|
return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this);
|
||||||
|
File diff suppressed because one or more lines are too long
2
build/dat.gui.min.js
vendored
2
build/dat.gui.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1169,6 +1169,9 @@ var NumberControllerBox = function (_NumberController) {
|
|||||||
createClass(NumberControllerBox, [{
|
createClass(NumberControllerBox, [{
|
||||||
key: 'updateDisplay',
|
key: 'updateDisplay',
|
||||||
value: function updateDisplay() {
|
value: function updateDisplay() {
|
||||||
|
if (this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||||
return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this);
|
return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this);
|
||||||
}
|
}
|
||||||
@ -1238,6 +1241,9 @@ var NumberControllerSlider = function (_NumberController) {
|
|||||||
createClass(NumberControllerSlider, [{
|
createClass(NumberControllerSlider, [{
|
||||||
key: 'updateDisplay',
|
key: 'updateDisplay',
|
||||||
value: function updateDisplay() {
|
value: function updateDisplay() {
|
||||||
|
if (this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
var pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
||||||
this.__foreground.style.width = pct * 100 + '%';
|
this.__foreground.style.width = pct * 100 + '%';
|
||||||
return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this);
|
return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this);
|
||||||
|
File diff suppressed because one or more lines are too long
@ -108,6 +108,10 @@ class NumberControllerBox extends NumberController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateDisplay() {
|
updateDisplay() {
|
||||||
|
if(this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision);
|
||||||
return super.updateDisplay();
|
return super.updateDisplay();
|
||||||
}
|
}
|
||||||
|
@ -109,6 +109,9 @@ class NumberControllerSlider extends NumberController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateDisplay() {
|
updateDisplay() {
|
||||||
|
if(this.__input === document.activeElement) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
const pct = (this.getValue() - this.__min) / (this.__max - this.__min);
|
||||||
this.__foreground.style.width = pct * 100 + '%';
|
this.__foreground.style.width = pct * 100 + '%';
|
||||||
return super.updateDisplay();
|
return super.updateDisplay();
|
||||||
|
Loading…
Reference in New Issue
Block a user