get element outside of interval function
This commit is contained in:
parent
43d4852129
commit
982ca15d80
|
@ -29,6 +29,7 @@ function connect(){
|
|||
|
||||
let wss_scheme=document.getElementById('wss_scheme').checked===true?'wss://':'ws://';
|
||||
let url=[wss_scheme,nwshost.value,':',nwsport.value,'/jsonrpc'].join('');
|
||||
let autorefresh=undefined;
|
||||
|
||||
ws=new WebSocket(url);
|
||||
ws.onerror=function(message){
|
||||
|
|
|
@ -89,13 +89,13 @@ function start_autorefresh(){
|
|||
'mainstopped':showstopped,
|
||||
'mainwaiting':showwaiting
|
||||
};
|
||||
let sidetags=document.getElementById('sidetags');
|
||||
let autorefresh=document.getElementById('autorefresh');
|
||||
return setInterval(function(){
|
||||
let showtagname=getattr(document.getElementById('sidetags'),'data-crtshow');
|
||||
getstat();
|
||||
if(document.getElementById('autorefresh').checked){
|
||||
if(showtagname in idfunc_dict){
|
||||
idfunc_dict[showtagname]();
|
||||
};
|
||||
if(autorefresh.checked){
|
||||
let func=idfunc_dict[getattr(sidetags,'data-crtshow')];
|
||||
if(!!func)func();
|
||||
};
|
||||
},500);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue