mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
fhemweb.js: always present error in a dialog (Forum #86548)
git-svn-id: https://svn.fhem.de/fhem/trunk@16546 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
85924d67d7
commit
88d3ee3944
@ -673,7 +673,7 @@ 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 isDef = true;
|
||||
var isDef = true, reloadIfOk = false;
|
||||
|
||||
if(newDef == undefined || $(this).attr("value").indexOf("modify") != 0) {
|
||||
isDef = false;
|
||||
@ -685,9 +685,12 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify
|
||||
var ifid = (devName+"-"+arg).replace(/([^_a-z0-9])/gi,
|
||||
function(m){ return "\\"+m });
|
||||
if($(".dval[informid="+ifid+"]").length == 0) {
|
||||
log("PSC reload");
|
||||
$(this).unbind('click').click();// No element found to replace, reload
|
||||
return;
|
||||
if(cmd == "attr") {
|
||||
reloadIfOk = true;
|
||||
} else {
|
||||
$(this).unbind('click').click();// No element found to replace, reload
|
||||
return;
|
||||
}
|
||||
}
|
||||
newDef = $(this).closest("form").find("input:text").val();
|
||||
if(newDef == undefined)
|
||||
@ -696,6 +699,8 @@ FW_inlineModify() // Do not generate a new HTML page upon pressing modify
|
||||
}
|
||||
|
||||
FW_cmd(FW_root+"?"+encodeURIComponent(cmd)+"&XHR=1", function(resp){
|
||||
if(!resp && reloadIfOk)
|
||||
location.reload();
|
||||
if(resp) {
|
||||
resp = FW_htmlQuote(resp);
|
||||
if(resp.indexOf("\n") >= 0)
|
||||
|
Loading…
Reference in New Issue
Block a user