diff --git a/fhem/FHEM/01_FHEMWEB.pm b/fhem/FHEM/01_FHEMWEB.pm index 99e8617db..8501a9068 100755 --- a/fhem/FHEM/01_FHEMWEB.pm +++ b/fhem/FHEM/01_FHEMWEB.pm @@ -852,6 +852,13 @@ FW_answerCall($) #Returns undef as FW_RETTYPE if it already sent a HTTP header no strict "refs"; ($FW_RETTYPE, $FW_RET) = &{$h->{FUNC}}($arg); + if(defined($FW_RETTYPE) && $FW_RETTYPE =~ m,text/html,) { + my $dataAttr = + "data-confirmDelete='" .AttrVal($FW_wname,"confirmDelete",1) ."' ". + "data-confirmJSError='".AttrVal($FW_wname,"confirmJSError",1)."' ". + "data-webName='$FW_wname '"; + $FW_RET =~ s/{NR} if( !$FW_id ); - FW_pO "\n"; + + my $dataAttr = + "data-confirmDelete='" .AttrVal($FW_wname,"confirmDelete",1) ."' ". + "data-confirmJSError='".AttrVal($FW_wname,"confirmJSError",1)."' ". + "data-webName='$FW_wname '"; + FW_pO "\n"; if($FW_activateInform) { $cmd = "style eventMonitor $FW_activateInform"; @@ -1037,10 +1049,7 @@ sub FW_addContent(;$) { my $add = ($_[0] ? " $_[0]" : ""); - FW_pO "
"; + FW_pO "
"; } sub diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js index 0ee041392..bde0cfb4f 100644 --- a/fhem/www/pgm2/fhemweb.js +++ b/fhem/www/pgm2/fhemweb.js @@ -35,7 +35,7 @@ window.onbeforeunload = function(e) window.onerror = function(errMsg, url, lineno) { url = url.replace(/.*\//,''); - if($("div#content").attr("data-confirmJSError") != 0) + if($("body").attr("data-confirmJSError") != 0) FW_okDialog(url+" line "+lineno+":
"+errMsg); } @@ -252,12 +252,12 @@ FW_filterIcons() function FW_confirmDelete() { - var d = $("div#content"); - var cd = $(d).attr("data-confirmDelete"); + var b = $("body"); + var cd = $(b).attr("data-confirmDelete"); if(!cd || cd == 0) return; - var wn = $(d).attr("data-webName"); - $(d).find("a").each(function(){ + var wn = $(b).attr("data-webName"); + $("div#content").find("a").each(function(){ var href = $(this).attr("href"); if(!href) return;