fix should not submit on initial execute
fix should call $.prototype.html function
This commit is contained in:
@@ -286,6 +286,7 @@ var testSuccess = function() {
|
|||||||
|
|
||||||
function showCompletion() {
|
function showCompletion() {
|
||||||
if (isInitRun) {
|
if (isInitRun) {
|
||||||
|
isInitRun = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var time = Math.floor(Date.now()) - started;
|
var time = Math.floor(Date.now()) - started;
|
||||||
@@ -479,7 +480,7 @@ var runTests = function(err, data) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function bonfireExecute(isInitRun) {
|
function bonfireExecute() {
|
||||||
goodTests = 0;
|
goodTests = 0;
|
||||||
attempts++;
|
attempts++;
|
||||||
ga('send', 'event', 'Challenge', 'ran-code', challenge_Name);
|
ga('send', 'event', 'Challenge', 'ran-code', challenge_Name);
|
||||||
@@ -566,18 +567,15 @@ $('#submitButton').on('click', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
var $preview = $('#preview');
|
||||||
isInitRun = true;
|
isInitRun = true;
|
||||||
editorValue = (codeStorage.isAlive())? codeStorage.getEditorValue() : allSeeds;
|
editorValue = (codeStorage.isAlive())? codeStorage.getEditorValue() : allSeeds;
|
||||||
myCodeMirror.setValue(editorValue.replace(/fccss/gi, '<script>').replace(/fcces/gi, "</script>"));
|
myCodeMirror.setValue(editorValue.replace(/fccss/gi, '<script>').replace(/fcces/gi, "</script>"));
|
||||||
if(typeof $('#preview').html !== 'undefined'){
|
if(typeof $preview.html() !== 'undefined') {
|
||||||
$('#preview').load(function(){
|
$preview.load(function(){
|
||||||
bonfireExecute(false);
|
bonfireExecute();
|
||||||
});
|
});
|
||||||
|
} else{
|
||||||
|
bonfireExecute();
|
||||||
}
|
}
|
||||||
else{
|
|
||||||
bonfireExecute(false);
|
|
||||||
}
|
|
||||||
setTimeout(function() {
|
|
||||||
isInitRun = false;
|
|
||||||
}, 1000);
|
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user