From 3065edf906c76edc01f79cd6ec1cf500460c2dea Mon Sep 17 00:00:00 2001 From: Matthew Borden Date: Wed, 9 Jul 2014 11:06:57 +1000 Subject: [PATCH] Fix: Firefox issues by adding Squire on load of iframe --- serve.js | 2 -- ui/Squire-UI.html | 62 +++++++++++++++++++---------------------------- ui/Squire-UI.js | 5 +++- 3 files changed, 29 insertions(+), 40 deletions(-) diff --git a/serve.js b/serve.js index 3f110cc..73c914a 100644 --- a/serve.js +++ b/serve.js @@ -7,8 +7,6 @@ var file = new static.Server('./'); function puts(error, stdout, stderr) { sys.puts(stdout) }; require('http').createServer(function (request, response) { -exec("make -f Makefile build", puts); -exec("make -f Makefile ui", puts); request.addListener('end', function () { file.serve(request, response); }).resume(); diff --git a/ui/Squire-UI.html b/ui/Squire-UI.html index 2cefb0b..7a29cdc 100644 --- a/ui/Squire-UI.html +++ b/ui/Squire-UI.html @@ -1,46 +1,34 @@ - - \ No newline at end of file + + diff --git a/ui/Squire-UI.js b/ui/Squire-UI.js index f6f7f53..7563def 100644 --- a/ui/Squire-UI.js +++ b/ui/Squire-UI.js @@ -40,8 +40,11 @@ $(document).ready(function () { $(container).append(div); $(container).append(iframe); + + iframe.addEventListener('load', function () { + iframe.contentWindow.editor = new Squire(iframe.contentWindow.document); + }); - iframe.contentWindow.editor = new Squire(iframe.contentWindow.document); return iframe.contentWindow.editor; };