File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -83,20 +83,22 @@ function handleHooksSuccess(hooks) {
8383}
8484
8585function startHooks ( ) {
86- $ . ajax ( {
87- url : globals . rootdir + "/ajax.php" ,
88- type : "get" ,
89- data : {
90- op : "hooks" ,
91- } ,
92- success : function ( data ) {
93- hooks = JSON . parse ( data ) ;
94- handleHooksSuccess ( hooks ) ;
95- } ,
96- error : function ( xhr , status , error ) {
97- console . error ( "Errore durante la richiesta AJAX relativa agli Hooks" ) ;
98- }
99- } ) ;
86+ if ( document . hasFocus ( ) ) {
87+ $ . ajax ( {
88+ url : globals . rootdir + "/ajax.php" ,
89+ type : "get" ,
90+ data : {
91+ op : "hooks" ,
92+ } ,
93+ success : function ( data ) {
94+ hooks = JSON . parse ( data ) ;
95+ handleHooksSuccess ( hooks ) ;
96+ } ,
97+ error : function ( xhr , status , error ) {
98+ console . error ( "Errore durante la richiesta AJAX relativa agli Hooks" ) ;
99+ }
100+ } ) ;
101+ }
100102}
101103
102104var timeout = 600 ;
You can’t perform that action at this time.
0 commit comments