api cache clean scroller
Showing
1 changed file
with
7 additions
and
1 deletions
@@ -113,13 +113,19 @@ | @@ -113,13 +113,19 @@ | ||
113 | layoutResize(); | 113 | layoutResize(); |
114 | 114 | ||
115 | var $logWrap = $('.yoho-log-dark'); | 115 | var $logWrap = $('.yoho-log-dark'); |
116 | + var timer = 0; | ||
116 | 117 | ||
117 | var ws = io(); | 118 | var ws = io(); |
118 | ws.on('connect', function() { | 119 | ws.on('connect', function() { |
119 | ws.on('/api_cache/log', function(data) { | 120 | ws.on('/api_cache/log', function(data) { |
120 | $('#api-cache-log').append('<p><span class="host">'+data.host+'</span><span class="message">'+data.msg+'</span></p>'); | 121 | $('#api-cache-log').append('<p><span class="host">'+data.host+'</span><span class="message">'+data.msg+'</span></p>'); |
121 | 122 | ||
122 | - $logWrap.scrollTop($logWrap[0].scrollHeight); | 123 | + if (timer == 0) { |
124 | + timer = setTimeout(function(){ | ||
125 | + $logWrap.scrollTop($logWrap[0].scrollHeight); | ||
126 | + timer = 0; | ||
127 | + }, 1000); | ||
128 | + } | ||
123 | }); | 129 | }); |
124 | }); | 130 | }); |
125 | ws.on('error', function() { | 131 | ws.on('error', function() { |
-
Please register or login to post a comment