forked from GithubBackups/vichan
Merge pull request #125 from ScriptKi77y/master
Scroll hook thread polling adjusttment.
This commit is contained in:
commit
cce53a5ac4
@ -129,6 +129,18 @@ $(document).ready(function(){
|
||||
clearInterval(countdown_interval);
|
||||
}
|
||||
|
||||
var epoch = (new Date).getTime();
|
||||
var epochold = epoch;
|
||||
|
||||
var timeDiff = function (delay) {
|
||||
if((epoch-epochold) > delay) {
|
||||
epochold = epoch = (new Date).getTime();
|
||||
return true;
|
||||
}else{
|
||||
epoch = (new Date).getTime();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var poll = function(manualUpdate) {
|
||||
stop_auto_update();
|
||||
@ -194,12 +206,12 @@ $(document).ready(function(){
|
||||
end_of_page = false;
|
||||
return;
|
||||
} else {
|
||||
if($("#auto_update_status").is(':checked')) {
|
||||
if($("#auto_update_status").is(':checked') && timeDiff(poll_interval_mindelay)) {
|
||||
poll(manualUpdate = true);
|
||||
}
|
||||
end_of_page = true;
|
||||
}
|
||||
}).trigger('scroll');
|
||||
});
|
||||
|
||||
$('#update_thread').on('click', function() { poll(manualUpdate = true); return false; });
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user