10
0
Fork 0

fixed: can't set default value

This commit is contained in:
Markus Schmidl 2016-03-25 02:27:38 +01:00
parent ef0f57fd0d
commit 1575675065
1 changed files with 7 additions and 3 deletions

View File

@ -54,7 +54,7 @@
<form id="changeLight">
<label for="fadestep">Umschaltzeit in Sekunden: </label>
<input name="fadestep" type="text" value="10"><br />
<input name="color" type="text" value="003d69" id="picker">
<!--<input name="color" type="text" value="003d69" id="picker">-->
<div id="picker2"></div>
<input id="mode-flashy" name="mode" type="radio" value="y">
<label for="mode-flashy">Hektisch</label>
@ -68,19 +68,23 @@
</form>
</div>
<script type="text/javascript">
default_color = 'ab571f';
$('#picker2').colpick({
layout:'hex',
submit:0,
colorScheme:'light',
flat: true,
color: 'ab571f',
color: default_color,
onChange:function(hsb,hex,rgb,el,bySetColor) {
// Fill the text box just if the color was set using the picker, and not the colpickSetColor function.
if(!bySetColor) $('#picker').val(hex);
if(!bySetColor){
$('#picker').val(hex);
}
}
}).keyup(function(){
$(this).colpickSetColor(this.value);
});
$('#picker').val(default_color);
var callback = function(event) {
event.preventDefault();
var data = $(this).serializeArray(),