Ugly fix for Temperature graph not displayed correctly

This commit is contained in:
Marc Hannappel committed 2016-12-12 13:41:56 +01:00
1 parent 32fc5ccd3e
commit 3bb0f51d08
2 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -497,7 +497,7 @@ def _process_templates():
# tabs
templates["tab"]["entries"] = dict(
temperature=(gettext("Temperature"), dict(template="tabs/temperature.jinja2", _div="temp", data_bind="visible: loginState.hasPermission(permissions.STATUS)")),
temperature=(gettext("Temperature"), dict(template="tabs/temperature.jinja2", _div="temp")),
control=(gettext("Control"), dict(template="tabs/control.jinja2", _div="control", data_bind="visible: loginState.hasPermission(permissions.CONTROL)")),
terminal=(gettext("Terminal"), dict(template="tabs/terminal.jinja2", _div="term", data_bind="visible: loginState.hasPermission(permissions.TERMINAL)")),
)
@@ -98,6 +98,20 @@ $(function() {
self.settingsViewModel.printerProfiles.currentProfileData().heatedBed.subscribe(self._printerProfileUpdated);
});
// TODO: find some nicer way to update plot AFTER graph becomes visible
self.loginState.hasPermission(self.permissions.STATUS).subscribe(function(value) {
var graph = $("#temp, #temp_link");
if (graph.length) {
if (value) {
graph.removeAttr("style");
}
else {
graph.hide();
}
}
self.updatePlot();
});
self.temperatures = [];
self.plotOptions = {
yaxis: {