1
0
Fork 0

faster detailgraph switching, changed checkbox img

This commit is contained in:
Heiko Kernbach 2013-05-22 17:25:15 +02:00
parent e0e4760abc
commit fef0d543aa
2 changed files with 11 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -7,6 +7,7 @@ var dashboardView = Backbone.View.extend({
seriesData: {},
charts: {},
units: [],
updateNOW: false,
detailGraph: "userTime",
initialize: function () {
@ -22,6 +23,12 @@ var dashboardView = Backbone.View.extend({
window.setInterval(function() {
self.updateCounter++;
if (self.updateNOW === true) {
self.calculateSeries();
self.renderCharts();
self.updateNOW = false;
}
if (self.updateCounter < self.updateFrequency) {
return false;
}
@ -74,7 +81,6 @@ var dashboardView = Backbone.View.extend({
var counter = 1;
$.each(this.options.description.models[0].attributes.groups, function () {
console.log(this);
$('.thumbnails').append(
'<ul class="statGroups" id="' + this.group + '">' +
'<i class="group-close icon-minus icon-white"></i>' +
@ -151,6 +157,7 @@ var dashboardView = Backbone.View.extend({
},
checkInterval: function (a) {
var self = this;
this.updateFrequency = a.target.value;
self.calculateSeries();
self.renderCharts();
@ -243,13 +250,14 @@ var dashboardView = Backbone.View.extend({
$.each(this.options.description.models[0].attributes.figures, function () {
if(this.identifier === self.detailGraph) {
$('#detailGraphHeader').text(this.name);
self.calculateSeries();
self.renderCharts();
$("html, body").animate({ scrollTop: 0 }, "slow");
$('#detailGraphChart').show();
$('#detailGraph').height(300);
$('#dbHideSwitch').addClass('icon-minus');
$('#dbHideSwitch').removeClass('icon-plus');
self.calculateSeries();
self.renderCharts();
self.updateNOW = true;
}
});
},