show exact slider values for better fine tuning

This commit is contained in:
Georg Fischer
2013-09-20 20:50:27 +02:00
parent c497b9fb87
commit f4aa6dc224
3 changed files with 20 additions and 4 deletions
+8
View File
@@ -23,6 +23,7 @@ define(
control.addEventListener( 'change', controlUpdated, false );
updateValue( control.id, control.value );
updateValueInUI( control.id, control.value );
}
is_initialized = true;
@@ -36,6 +37,7 @@ define(
var target = event.target;
updateValue( target.id, target.value );
updateValueInUI( target.id, target.value );
}
function updateValue( key, value )
@@ -48,6 +50,12 @@ define(
}
}
function updateValueInUI( key, value )
{
var el = document.querySelectorAll( 'label[for="' + key + '"] .control-slider-value' )[0];
el.innerHTML = value;
}
return { init: init };
}
);