From 280453047e03fc0678e0b86a909e114cc0e2b2dc Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Tue, 26 Apr 2016 19:36:00 +0000 Subject: [PATCH] fhemweb.js: fix psc setting the def on attr change (Forum #52379) git-svn-id: https://svn.fhem.de/fhem/trunk@11321 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/www/pgm2/fhemweb.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index c77b7d8e5..43aa6e2df 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -500,8 +500,10 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify var newDef = typeof cm !== 'undefined' ? cm.getValue() : $(this).closest("form").find("textarea").val(); var cmd = $(this).attr("name")+"="+$(this).attr("value")+" "+newDef; + var noDef; if( newDef == undefined ) { + noDef = true; var div = $(this).closest("div.makeSelect"); var devName = $(div).attr("dev"), cmd = $(div).attr("cmd"); @@ -510,7 +512,7 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify var ifid = devName.replace(/\./g, '\\.'); if($(".dval[informid="+ifid+"-"+arg+"]").length == 0) { console.log(this); - $(this).unbind('click').click();// No element found to replace + $(this).unbind('click').click();// No element found to replace, reload return; } newDef = $(this).closest("form").find("input:text").val(); @@ -527,8 +529,10 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify .replace(/>/g, '>'); if(newDef.indexOf("\n") >= 0) newDef = '
'+newDef+''; - $("div#disp").html(newDef).css("display", ""); - $("div#edit").css("display", "none"); + if(!noDef) { + $("div#disp").html(newDef).css("display", ""); + $("div#edit").css("display", "none"); + } }); }); }