@@ -103,10 +103,9 @@ function executeCode(forceStartingInstr, forceRawInputLst) {
103103
104104function officeMixFinishSuccessfulExecution ( ) {
105105 updateAppDisplayForMix ( 'display' ) ; // do this first
106- $ ( '#pyOutputPane #editCodeLinkDiv' ) . hide ( ) ; // don't have explicit "Edit code" link
107106 $ ( '#loadingPane' ) . hide ( ) ;
108107
109- $ ( "#toggleModebtn " ) . html ( "Edit code" ) ;
108+ $ ( "#vizBtn " ) . hide ( ) ;
110109
111110 if ( _savedCurInstr !== undefined ) {
112111 myVisualizer . renderStep ( _savedCurInstr ) ;
@@ -176,7 +175,7 @@ function getAppStateWithTraceCache() {
176175
177176function enterOPTEditCodeMode ( ) {
178177 updateAppDisplayForMix ( 'edit' ) ;
179- $ ( "#toggleModebtn " ) . html ( "Visualize code " ) . show ( ) ;
178+ $ ( "#vizBtn " ) . html ( "Visualize Execution " ) . show ( ) ;
180179
181180 // https://groups.google.com/forum/#!msg/ace-discuss/TQHqey_NkBg/q9x_tLrvsXoJ
182181 pyInputAceEditor . resize ( ) ; // weird hack that's necessary to refresh the editor's latest text values. #weird
@@ -225,6 +224,10 @@ function updateAppDisplayForMix(newAppMode) {
225224
226225 // customize edit button click functionality AFTER rendering (NB: awkward!)
227226 $ ( '#pyOutputPane #editCodeLinkDiv' ) . show ( ) ;
227+ $ ( '#pyOutputPane #editBtn' ) . click ( function ( ) {
228+ enterOPTEditCodeMode ( ) ;
229+ } ) ;
230+
228231 $ . bbq . pushState ( { mode : 'display' } , 2 /* completely override other hash strings to keep URL clean */ ) ;
229232 } else {
230233 assert ( false ) ;
@@ -373,12 +376,8 @@ $(document).ready(function() {
373376
374377 $ ( '#pythonVersionSelector' ) . change ( setAceMode ) ;
375378
376- $ ( "#toggleModebtn" ) . click ( function ( ) {
377- if ( appMode == 'edit' ) {
378- mixLazyExecuteCode ( ) ;
379- } else {
380- enterOPTEditCodeMode ( ) ;
381- }
379+ $ ( "#vizBtn" ) . click ( function ( ) {
380+ mixLazyExecuteCode ( ) ;
382381 } ) ;
383382
384383 // To run in https://labsjs.blob.core.windows.net/sdk/LabsJS-1.0.4/labshost.html
0 commit comments