Skip to content

Commit ec6714a

Browse files
committed
ugh bug fix
1 parent ad8d5f1 commit ec6714a

4 files changed

Lines changed: 14 additions & 9 deletions

File tree

v3/js/composingprograms.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3838

3939

4040
$(document).ready(function() {
41-
genericOptFrontendReady(); // initialize at the beginning
4241
setSurveyHTML();
4342

4443
$("#embedLinkDiv").hide();
@@ -118,4 +117,6 @@ $(document).ready(function() {
118117

119118
$("#executeBtn").attr('disabled', false);
120119
$("#executeBtn").click(executeCodeFromScratch);
120+
121+
genericOptFrontendReady(); // initialize at the end
121122
});

v3/js/csc108h.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
3939

4040

4141
$(document).ready(function() {
42-
genericOptFrontendReady(); // initialize at the beginning
4342
setSurveyHTML();
4443

4544
$("#embedLinkDiv").hide();
@@ -121,4 +120,6 @@ $(document).ready(function() {
121120

122121
$("#executeBtn").attr('disabled', false);
123122
$("#executeBtn").click(executeCodeFromScratch);
123+
124+
genericOptFrontendReady(); // initialize at the end
124125
});

v3/js/opt-frontend-common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ function redrawConnectors() {
103103
}
104104

105105

106-
// run in the BEGINNING
106+
// run at the END so that everything else can be initialized first
107107
function genericOptFrontendReady() {
108108
pyInputCodeMirror = CodeMirror(document.getElementById('codeInputPane'), {
109109
mode: 'python',

v3/js/opt-frontend.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,6 @@ function executeCodeWithRawInput(rawInputStr, curInstr) {
403403

404404

405405
$(document).ready(function() {
406-
genericOptFrontendReady(); // initialize at the beginning
407406
setSurveyHTML();
408407

409408
$("#embedLinkDiv").hide();
@@ -701,11 +700,6 @@ $(document).ready(function() {
701700
});
702701

703702

704-
// if blank, then select a canned example on start-up
705-
if (!pyInputCodeMirror.getValue()) {
706-
$("#aliasExampleLink").trigger('click');
707-
}
708-
709703
$('#genEmbedBtn').bind('click', function() {
710704
assert(appMode == 'display' || appMode == 'visualize' /* 'visualize' is deprecated */);
711705
var myArgs = getAppState();
@@ -735,4 +729,13 @@ $(document).ready(function() {
735729
$.get('survey.py', myArgs, function(dat) {});
736730
}
737731
});
732+
733+
genericOptFrontendReady(); // initialize at the end
734+
735+
736+
// if blank, then select a canned example on start-up
737+
// (need to do this after pyInputCodeMirror is initialized)
738+
if (!pyInputCodeMirror.getValue()) {
739+
$("#aliasExampleLink").trigger('click');
740+
}
738741
});

0 commit comments

Comments
 (0)