hooked class attributeses properly on Number Controller and Slider

This commit is contained in:
Jono Brandel 2011-02-10 14:51:52 -08:00
parent 5b69223ef8
commit d24b0c74fc
3 changed files with 7 additions and 1 deletions

View File

@ -85,6 +85,7 @@ GUI.NumberController = function() {
numberField.focus();
numberField.select();
}
if(slider) slider.domElement.className = slider.domElement.className.replace(' active', '');
draggedNumberField = false;
clickedNumberField = false;
if (_this.finishChangeFunction != null) {
@ -106,6 +107,8 @@ GUI.NumberController = function() {
GUI.makeUnselectable(_this.parent.domElement);
GUI.makeUnselectable(numberField);
if(slider) slider.domElement.className += ' active';
py = y;
y = e.pageY;
var dy = py - y;

View File

@ -46,6 +46,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
x = px = e.pageX;
_this.domElement.setAttribute('class', 'guidat-slider-bg active');
_this.fg.setAttribute('class', 'guidat-slider-fg active');
numberController.domElement.className += ' active';
onDrag(e);
document.addEventListener('mouseup', mouseup, false);
}, false);
@ -54,6 +55,7 @@ GUI.Slider = function(numberController, min, max, step, initValue) {
var mouseup = function(e) {
_this.domElement.setAttribute('class', 'guidat-slider-bg');
_this.fg.setAttribute('class', 'guidat-slider-fg');
numberController.domElement.className = numberController.domElement.className.replace(' active', '');
clicked = false;
if (numberController.finishChangeFunction != null) {
numberController.finishChangeFunction.call(this, numberController.getValue());

View File

@ -86,7 +86,8 @@ a.guidat-toggle:hover {
float: right;
}
.guidat-controller input:hover {
.guidat-controller input:hover.
.guidat-controller.number.active {
background-color: #444;
}