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">
|
<form id="changeLight">
|
||||||
<label for="fadestep">Umschaltzeit in Sekunden: </label>
|
<label for="fadestep">Umschaltzeit in Sekunden: </label>
|
||||||
<input name="fadestep" type="text" value="10"><br />
|
<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>
|
<div id="picker2"></div>
|
||||||
<input id="mode-flashy" name="mode" type="radio" value="y">
|
<input id="mode-flashy" name="mode" type="radio" value="y">
|
||||||
<label for="mode-flashy">Hektisch</label>
|
<label for="mode-flashy">Hektisch</label>
|
||||||
|
@ -68,19 +68,23 @@
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
default_color = 'ab571f';
|
||||||
$('#picker2').colpick({
|
$('#picker2').colpick({
|
||||||
layout:'hex',
|
layout:'hex',
|
||||||
submit:0,
|
submit:0,
|
||||||
colorScheme:'light',
|
colorScheme:'light',
|
||||||
flat: true,
|
flat: true,
|
||||||
color: 'ab571f',
|
color: default_color,
|
||||||
onChange:function(hsb,hex,rgb,el,bySetColor) {
|
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.
|
// 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(){
|
}).keyup(function(){
|
||||||
$(this).colpickSetColor(this.value);
|
$(this).colpickSetColor(this.value);
|
||||||
});
|
});
|
||||||
|
$('#picker').val(default_color);
|
||||||
var callback = function(event) {
|
var callback = function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var data = $(this).serializeArray(),
|
var data = $(this).serializeArray(),
|
||||||
|
|
Loading…
Reference in New Issue