Revert "Some Changed to the temperature.js file"

This reverts commit ce2463588d.
This commit is contained in:
Marc Hannappel committed 2017-10-25 15:11:53 +02:00
1 parent 68c57cc4eb
commit 052408982a
1 file changed
+21 -10
@@ -68,6 +68,9 @@ $(function() {
};
self.changeOffsetDialog = undefined;
// TODO: find some nicer way to update plot AFTER graph becomes visible
self.loginStateSubscription = undefined;
self.tools = ko.observableArray([]);
self.hasBed = ko.observable(true);
@@ -152,17 +155,25 @@ $(function() {
self.settingsViewModel.printerProfiles.currentProfileData().heatedBed.subscribe(self._printerProfileUpdated);
});
self.loginState.hasPermissionKo(self.access.permissions.STATUS).subscribe(function(value) {
var graph = $("#temp, #temp_link");
if (graph.length) {
if (value) {
graph.removeAttr("style");
}
else {
graph.hide();
}
// TODO: find some nicer way to update plot AFTER graph becomes visible
self.access.permissions.permissionsList.subscribe(function(values) {
if (self.loginStateSubscription !== undefined) {
self.loginStateSubscription.dispose();
self.loginStateSubscription = undefined;
}
self.updatePlot();
self.loginStateSubscription = self.loginState.hasPermissionKo(self.access.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 = [];