From d3cc444cad1fed8b436df0af5b9baa5f850dce77 Mon Sep 17 00:00:00 2001 From: Jono Brandel Date: Thu, 10 Feb 2011 14:51:52 -0800 Subject: [PATCH] hooked class attributeses properly on Number Controller and Slider --- controllers/controller.number.js | 3 +++ controllers/slider.js | 2 ++ gui.css | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/controllers/controller.number.js b/controllers/controller.number.js index 4a63372..1af4683 100644 --- a/controllers/controller.number.js +++ b/controllers/controller.number.js @@ -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; diff --git a/controllers/slider.js b/controllers/slider.js index b3ad28a..d129942 100644 --- a/controllers/slider.js +++ b/controllers/slider.js @@ -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()); diff --git a/gui.css b/gui.css index db24012..5543fd5 100644 --- a/gui.css +++ b/gui.css @@ -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; }