mirror of
https://github.com/dataarts/dat.gui.git
synced 2024-12-12 04:08:27 +00:00
hooked class attributeses properly on Number Controller and Slider
This commit is contained in:
parent
765ade71e9
commit
d3cc444cad
@ -85,6 +85,7 @@ GUI.NumberController = function() {
|
|||||||
numberField.focus();
|
numberField.focus();
|
||||||
numberField.select();
|
numberField.select();
|
||||||
}
|
}
|
||||||
|
if(slider) slider.domElement.className = slider.domElement.className.replace(' active', '');
|
||||||
draggedNumberField = false;
|
draggedNumberField = false;
|
||||||
clickedNumberField = false;
|
clickedNumberField = false;
|
||||||
if (_this.finishChangeFunction != null) {
|
if (_this.finishChangeFunction != null) {
|
||||||
@ -106,6 +107,8 @@ GUI.NumberController = function() {
|
|||||||
GUI.makeUnselectable(_this.parent.domElement);
|
GUI.makeUnselectable(_this.parent.domElement);
|
||||||
GUI.makeUnselectable(numberField);
|
GUI.makeUnselectable(numberField);
|
||||||
|
|
||||||
|
if(slider) slider.domElement.className += ' active';
|
||||||
|
|
||||||
py = y;
|
py = y;
|
||||||
y = e.pageY;
|
y = e.pageY;
|
||||||
var dy = py - y;
|
var dy = py - y;
|
||||||
|
@ -46,6 +46,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
|
|||||||
x = px = e.pageX;
|
x = px = e.pageX;
|
||||||
_this.domElement.setAttribute('class', 'guidat-slider-bg active');
|
_this.domElement.setAttribute('class', 'guidat-slider-bg active');
|
||||||
_this.fg.setAttribute('class', 'guidat-slider-fg active');
|
_this.fg.setAttribute('class', 'guidat-slider-fg active');
|
||||||
|
numberController.domElement.className += ' active';
|
||||||
onDrag(e);
|
onDrag(e);
|
||||||
document.addEventListener('mouseup', mouseup, false);
|
document.addEventListener('mouseup', mouseup, false);
|
||||||
}, false);
|
}, false);
|
||||||
@ -54,6 +55,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
|
|||||||
var mouseup = function(e) {
|
var mouseup = function(e) {
|
||||||
_this.domElement.setAttribute('class', 'guidat-slider-bg');
|
_this.domElement.setAttribute('class', 'guidat-slider-bg');
|
||||||
_this.fg.setAttribute('class', 'guidat-slider-fg');
|
_this.fg.setAttribute('class', 'guidat-slider-fg');
|
||||||
|
numberController.domElement.className = numberController.domElement.className.replace(' active', '');
|
||||||
clicked = false;
|
clicked = false;
|
||||||
if (numberController.finishChangeFunction != null) {
|
if (numberController.finishChangeFunction != null) {
|
||||||
numberController.finishChangeFunction.call(this, numberController.getValue());
|
numberController.finishChangeFunction.call(this, numberController.getValue());
|
||||||
|
Loading…
Reference in New Issue
Block a user