@@ -388,25 +388,34 @@ function downloadImgFormQrcode(idName)
388388}
389389
390390//--------------------------------------set document tile---------------------------------------------
391-
391+ intervalId = undefined
392392function setDocumentTitle ( )
393393{
394394 iconNum = 0 ;
395- intervalId = setInterval ( function ( ) {
396- var siteTip = localStorage . getItem ( newSiteTipKey ) ;
397- if ( siteTip == "clear" ) {
398- $ ( ".icon" ) . attr ( "href" , "favicon.ico" ) ;
399- iconNum = 0 ;
400- clearInterval ( intervalId ) ;
401- } else {
402- if ( Number ( iconNum % 2 ) == 0 ) {
395+ var siteTip = localStorage . getItem ( newSiteTipKey ) ;
396+
397+ if ( intervalId == undefined && siteTip != "clear" ) {
398+ intervalId = setInterval ( function ( ) {
399+ if ( siteTip == "clear" ) {
403400 $ ( ".icon" ) . attr ( "href" , "favicon.ico" ) ;
401+ iconNum = 0 ;
404402 } else {
405- $ ( ".icon" ) . attr ( "href" , "tip.png" ) ;
403+ if ( Number ( iconNum % 2 ) == 0 ) {
404+ $ ( ".icon" ) . attr ( "href" , "favicon.ico" ) ;
405+ } else {
406+ $ ( ".icon" ) . attr ( "href" , "tip.png" ) ;
407+ }
408+ iconNum = Number ( iconNum + 1 ) ;
406409 }
407- iconNum = Number ( iconNum + 1 ) ;
408- }
409- } , 500 ) ;
410+ } , 500 ) ;
411+ }
412+ if ( siteTip == "clear" && intervalId != undefined ) {
413+ $ ( ".icon" ) . attr ( "href" , "favicon.ico" ) ;
414+ iconNum = 0 ;
415+ clearInterval ( intervalId ) ;
416+ intervalId = undefined
417+ }
418+
410419}
411420
412421//--------------------------------------logout----------------------------------------------
0 commit comments