0
0
mirror of https://github.com/Doodle3D/doodle3d-client.git synced 2024-11-22 09:17:56 +01:00

additions to Thermometer to allow the general Update function to show() and hide() the Thermometer's container DIV

This commit is contained in:
Adriaan Wormgoor 2013-09-18 10:57:46 +02:00
parent 77b6ed3357
commit 82165c585b
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,5 @@
var $displayThermometer;
function Thermometer() { function Thermometer() {
this.currentTemperature = 0; // default val this.currentTemperature = 0; // default val
this.targetTemperature = 180; // default val this.targetTemperature = 180; // default val
@ -20,9 +22,11 @@ function Thermometer() {
[244, 50, 50] // 'ready / hot' [244, 50, 50] // 'ready / hot'
]; ];
this.init = function(targCanvas) { this.init = function(targCanvas, targCanvasContainer) {
console.log("Thermometer.init()"); console.log("Thermometer.init()");
$displayThermometer = targCanvasContainer;
this.$canvas = targCanvas; this.$canvas = targCanvas;
this.canvas = this.$canvas[0]; this.canvas = this.$canvas[0];
this.context = this.canvas.getContext('2d'); this.context = this.canvas.getContext('2d');

View File

@ -37,7 +37,7 @@ $(function() {
initPreviewRendering(); initPreviewRendering();
initButtonBehavior(); initButtonBehavior();
thermometer.init($("#thermometerCanvas")); thermometer.init($("#thermometerCanvas"), $("#thermometerContainer"));
printer.init(); printer.init();
$(document).on(Printer.UPDATE,update); $(document).on(Printer.UPDATE,update);