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

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
This commit is contained in:
rudolfkoenig 2016-04-26 19:36:00 +00:00
parent ea1644162f
commit 280453047e

View File

@ -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 = '<pre>'+newDef+'</pre>';
if(!noDef) {
$("div#disp").html(newDef).css("display", "");
$("div#edit").css("display", "none");
}
});
});
}