From 56a08097686d1b486672f930fcc97d3c71c0b4b5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Thu, 27 Nov 2014 23:01:48 +0000 Subject: [PATCH] Fix problem with edit-bitmap widget static rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ‘introduction’ edition contains an edit-bitmap widget that was failing under Node.js because the fake dom doesn’t support canvas. --- core/modules/widgets/edit-bitmap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/modules/widgets/edit-bitmap.js b/core/modules/widgets/edit-bitmap.js index 11728bea0..b94b24955 100644 --- a/core/modules/widgets/edit-bitmap.js +++ b/core/modules/widgets/edit-bitmap.js @@ -80,7 +80,9 @@ EditBitmapWidget.prototype.render = function(parent,nextSibling) { parent.insertBefore(this.heightDomNode,nextSibling); this.domNodes.push(this.canvasDomNode,this.widthDomNode,this.heightDomNode); // Load the image into the canvas - this.loadCanvas(); + if($tw.browser) { + this.loadCanvas(); + } }; /*