File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,24 +120,7 @@ function setVisibleAppState(appState) {
120120}
121121
122122
123- $ ( document ) . ready ( function ( ) {
124- setSurveyHTML ( ) ;
125-
126- $ ( "#embedLinkDiv" ) . hide ( ) ;
127-
128- pyInputCodeMirror = CodeMirror ( document . getElementById ( 'codeInputPane' ) , {
129- mode : 'python' ,
130- lineNumbers : true ,
131- tabSize : 4 ,
132- indentUnit : 4 ,
133- // convert tab into four spaces:
134- extraKeys : { Tab : function ( cm ) { cm . replaceSelection ( " " , "end" ) ; } }
135- } ) ;
136-
137- pyInputCodeMirror . setSize ( null , '420px' ) ;
138-
139-
140- if ( enableTogetherJS ) {
123+ function initTogetherJS ( ) {
141124 $ ( "#surveyHeader" ) . remove ( ) ; // kill this to save space
142125
143126 var role = $ . bbq . getState ( 'role' ) ;
@@ -318,6 +301,28 @@ $(document).ready(function() {
318301 $ ( "#togetherBtn" ) . html ( "Get live help now" ) ;
319302 }
320303 } ) ;
304+ }
305+
306+
307+ $ ( document ) . ready ( function ( ) {
308+ setSurveyHTML ( ) ;
309+
310+ $ ( "#embedLinkDiv" ) . hide ( ) ;
311+
312+ pyInputCodeMirror = CodeMirror ( document . getElementById ( 'codeInputPane' ) , {
313+ mode : 'python' ,
314+ lineNumbers : true ,
315+ tabSize : 4 ,
316+ indentUnit : 4 ,
317+ // convert tab into four spaces:
318+ extraKeys : { Tab : function ( cm ) { cm . replaceSelection ( " " , "end" ) ; } }
319+ } ) ;
320+
321+ pyInputCodeMirror . setSize ( null , '420px' ) ;
322+
323+
324+ if ( enableTogetherJS ) {
325+ initTogetherJS ( ) ; // can also call this manually as well
321326 }
322327
323328
You can’t perform that action at this time.
0 commit comments