mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
addEventListener-fied NavigationController
This commit is contained in:
parent
a9b391e971
commit
76278bf1a0
@ -24,10 +24,10 @@ var NumberController = function() {
|
||||
button.setAttribute('value', inc)
|
||||
this.domElement.appendChild(button);
|
||||
|
||||
button.onmousedown = function(e) {
|
||||
button.addEventListener('mousedown', function(e) {
|
||||
isClicked = true;
|
||||
};
|
||||
button.onkeyup = function(e) {
|
||||
}, false);
|
||||
button.addEventListener('keyup', function(e) {
|
||||
var val = parseFloat(this.value);
|
||||
if(isNaN(val)) {
|
||||
inc = initialValue;
|
||||
@ -36,11 +36,11 @@ var NumberController = function() {
|
||||
}
|
||||
this.value = inc;
|
||||
_this.setValue(inc);
|
||||
}
|
||||
document.onmouseup = function(e) {
|
||||
}, false);
|
||||
document.addEventListener('mouseup', function(e) {
|
||||
isClicked = false;
|
||||
};
|
||||
document.onmousemove = function(e) {
|
||||
}, false);
|
||||
document.addEventListener('mousemove', function(e) {
|
||||
if(isClicked) {
|
||||
e.preventDefault();
|
||||
py = y;
|
||||
@ -61,7 +61,7 @@ var NumberController = function() {
|
||||
button.value = inc;
|
||||
_this.setValue(inc);
|
||||
}
|
||||
};
|
||||
}, false);
|
||||
|
||||
this.__defineSetter__("position", function(val) {
|
||||
inc = val;
|
||||
|
@ -20,12 +20,12 @@ var StringController = function() {
|
||||
_this.setValue(input.value);
|
||||
}, false);
|
||||
|
||||
input.onblur = function(e) {
|
||||
input.addEventListener('blur', function(e) {
|
||||
if(_this.getValue() == '') {
|
||||
_this.setValue(initialValue);
|
||||
this.value = initialValue;
|
||||
}
|
||||
};
|
||||
}, false);
|
||||
|
||||
this.domElement.appendChild(input);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user