forked from ChCh/chch-licht_github
fixed: can't set default value
This commit is contained in:
parent
ef0f57fd0d
commit
1575675065
10
index.html
10
index.html
|
@ -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(),
|
||||
|
|
Loading…
Reference in New Issue