Commit 67622b86 by Bach Dániel

dashboard: move activity vars

parent 5f3e7e7b
var in_progress = false;
var activity_hash = 5;
var show_all = false;
var reload_vm_detail = false;
$(function() { $(function() {
var in_progress = false;
var activity_hash = 5;
var show_all = false;
var reload_vm_detail = false;
/* do we need to check for new activities */ /* do we need to check for new activities */
if(decideActivityRefresh()) { if(decideActivityRefresh()) {
if(!in_progress) { if(!in_progress) {
...@@ -102,19 +102,16 @@ $(function() { ...@@ -102,19 +102,16 @@ $(function() {
return false; return false;
}); });
}); function decideActivityRefresh() {
function decideActivityRefresh() {
var check = false; var check = false;
/* if something is still spinning */ /* if something is still spinning */
if($('.timeline .activity i').hasClass('fa-spin')) if($('.timeline .activity i').hasClass('fa-spin'))
check = true; check = true;
return check; return check;
} }
function checkNewActivity(runs) { function checkNewActivity(runs) {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: $('a[href="#activity"]').attr('data-activity-url'), url: $('a[href="#activity"]').attr('data-activity-url'),
...@@ -178,7 +175,9 @@ function checkNewActivity(runs) { ...@@ -178,7 +175,9 @@ function checkNewActivity(runs) {
in_progress = false; in_progress = false;
} }
}); });
} }
});
String.prototype.hashCode = function() { String.prototype.hashCode = function() {
var hash = 0, i, chr, len; var hash = 0, i, chr, len;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment