2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

fhemweb_colorpicker.js: added temporary setValueFn before loadScript callback for jscolor

git-svn-id: https://svn.fhem.de/fhem/trunk@7663 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2015-01-23 01:41:28 +00:00
parent 27901264ca
commit 812a60dd3e

View File

@ -8,6 +8,9 @@ FW_widgets['colorpicker'] = {
function
FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
{
if(!vArr.length || vArr[0] != "colorpicker")
return undefined;
if( 0 ) {
console.log( "elName: "+elName );
console.log( "devName: "+devName );
@ -18,10 +21,6 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
console.log( "cmd: "+cmd );
}
if(!vArr.length || vArr[0] != "colorpicker")
return undefined;
var mode = "RGB";
if( vArr.length >= 1 )
mode = vArr[1]
@ -59,6 +58,8 @@ FW_colorpickerCreate(elName, devName, vArr, currVal, set, params, cmd)
var inp = $(newEl).find("[type=text]");
newEl.setValueFn = function(arg){ if( arg.length > 6 ) arg = arg.slice(0,6); $(inp).val(arg); }
loadScript("jscolor/jscolor.js",
function() {
var myPicker = new jscolor.color(inp.get(0),