mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-21 07:56:03 +00:00
fhemweb_colorpicker.js: fix for rgb preset mode if widgetOverride rgb:HSV is used
git-svn-id: https://svn.fhem.de/fhem/trunk@12567 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
574308d328
commit
a741be83d1
@ -26,7 +26,18 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
|
|||||||
mode = vArr[1]
|
mode = vArr[1]
|
||||||
//console.log( "mode: "+mode );
|
//console.log( "mode: "+mode );
|
||||||
|
|
||||||
var cmds = []; // the 3 commands vor hue, sat, bri
|
//preset ?
|
||||||
|
if( params && params.length ) {
|
||||||
|
var color = params[0];
|
||||||
|
if( mode == 'CT' )
|
||||||
|
color = colorpicker_ct2rgb(color);
|
||||||
|
|
||||||
|
var newEl = $('<div informID="###" style="width:32px;height:19px;border:1px solid #fff;border-radius:8px;background-color:#'+color+'" >').get(0);
|
||||||
|
$(newEl).click(function(arg) { cmd(params[0]) });
|
||||||
|
return newEl;
|
||||||
|
}
|
||||||
|
|
||||||
|
var cmds = []; // the 3 commands für hue, sat, bri
|
||||||
var ranges = []; // the 3 slider ranges
|
var ranges = []; // the 3 slider ranges
|
||||||
var is_real_hsv = false;
|
var is_real_hsv = false;
|
||||||
if( vArr.length == 14 ) { // hsv:colorpicker,HSV,hue,0,1,360,sat,0,1,100,bri,0,1,100
|
if( vArr.length == 14 ) { // hsv:colorpicker,HSV,hue,0,1,360,sat,0,1,100,bri,0,1,100
|
||||||
@ -168,18 +179,6 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
|
|||||||
if( mode == 'HSV' )
|
if( mode == 'HSV' )
|
||||||
return createHSVSliders();
|
return createHSVSliders();
|
||||||
|
|
||||||
//preset ?
|
|
||||||
if( params && params.length ) {
|
|
||||||
var color = params[0];
|
|
||||||
if( mode == 'CT' )
|
|
||||||
color = colorpicker_ct2rgb(color);
|
|
||||||
|
|
||||||
var newEl = $('<div informID="###" style="width:32px;height:19px;border:1px solid #fff;border-radius:8px;background-color:#'+color+'" >').get(0);
|
|
||||||
$(newEl).click(function(arg) { cmd(params[0]) });
|
|
||||||
return newEl;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if( mode == 'CT' ) {
|
if( mode == 'CT' ) {
|
||||||
if( currVal )
|
if( currVal )
|
||||||
currVal = currVal.match(/[\d.\-]*/)[0];
|
currVal = currVal.match(/[\d.\-]*/)[0];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user