From ebaf602737be114029f3d37f68dc46cdbdbc28a2 Mon Sep 17 00:00:00 2001 From: Hendrik Fellerhoff Date: Mon, 26 Mar 2012 13:45:37 +0200 Subject: [PATCH] bugfix im prototype --- src/main/webapp/WEB-INF/jsp/index.jsp | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/WEB-INF/jsp/index.jsp b/src/main/webapp/WEB-INF/jsp/index.jsp index b793aef..4fdea5e 100644 --- a/src/main/webapp/WEB-INF/jsp/index.jsp +++ b/src/main/webapp/WEB-INF/jsp/index.jsp @@ -118,8 +118,21 @@ }); $('#par56select').change(function() { $('#par56select option:selected').each(function() { - var hexstring = '#' + devices[$(this).attr('name')].red.toString(16) + devices[$(this).attr('name')].green.toString(16) + devices[$(this).attr('name')].blue.toString(16); - console.log(hexstring); + var red = devices[$(this).attr('name')].red.toString(16); + if(red.length == 1) { + red += red; + } + var green = devices[$(this).attr('name')].green.toString(16); + if(green.length == 1) { + green += green; + } + var blue = devices[$(this).attr('name')].blue.toString(16); + if(blue.length == 1) { + + blue += blue; + } + var hexstring = '#' + red + green + blue; + console.log(hexstring); colorpicker_raum1.hex(hexstring); }); }); @@ -208,4 +221,4 @@ - \ No newline at end of file +