From d23f1e4d28bc96cda4663f5cf74339f0ad237228 Mon Sep 17 00:00:00 2001 From: benmcmahon100 Date: Wed, 26 Aug 2015 00:13:07 +0100 Subject: [PATCH] Fixed bonfire auto-execute on html challenges --- public/js/lib/coursewares/commonFrameWork.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/js/lib/coursewares/commonFrameWork.js b/public/js/lib/coursewares/commonFrameWork.js index 573b779935..c2987aed27 100644 --- a/public/js/lib/coursewares/commonFrameWork.js +++ b/public/js/lib/coursewares/commonFrameWork.js @@ -564,5 +564,12 @@ $('#submitButton').on('click', function() { $(document).ready(function(){ editorValue = (codeStorage.isAlive())? codeStorage.getEditorValue() : allSeeds; myCodeMirror.setValue(editorValue.replace(/fccss/gi, '")); - bonfireExecute(); + if(typeof $('#preview').html !== 'undefined'){ + $('#preview').load(function(){ + bonfireExecute(); + }); + } + else{ + bonfireExecute(); + } });