File tree Expand file tree Collapse file tree
notebookjs/src/public/javascripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -77,6 +77,7 @@ function exec_cell(c_id) {
7777 }
7878 }
7979
80+ // $(`#out_${id}`).empty()
8081 $ ( `#out_${ id } ` ) . html ( output ) ;
8182 // document.getElementById("cell_spinner-1").style.display = "none"
8283 // document.getElementById("cell_num-1").style.display = "block"
Original file line number Diff line number Diff line change @@ -89,7 +89,8 @@ function this_div() {
8989
9090function viz ( name , callback ) {
9191 // out_div-1
92- let id = `#out_div${ window . current_cell } `
92+
93+ let id = `#out_${ window . current_cell } `
9394 $ ( `${ id } ` ) . append ( `<div id=${ name } ></div>` )
9495
9596 let cb = callback ( name ) ;
@@ -270,10 +271,11 @@ function html_load(new_id) {
270271
271272function load_notebook ( json ) {
272273
273-
274+ cells_order = [ ]
274275 for ( let key in json ) {
275276
276277 let id = key . split ( "-" ) [ 1 ]
278+
277279
278280 if ( Object . prototype . hasOwnProperty . call ( json [ key ] , "in" ) ) {
279281 let html = html_load ( id )
@@ -291,6 +293,7 @@ function load_notebook(json) {
291293 editor . getDoc ( ) . setValue ( input ) ;
292294
293295 vars_in_scope [ `div-${ id } ` ] = editor
296+ cells_order . push ( `div-${ id } ` )
294297
295298 let out = json [ key ] [ "out" ]
296299
@@ -327,6 +330,7 @@ function load_notebook(json) {
327330 md_texts [ `text-div_${ Number ( id ) } ` ] = md_out ;
328331
329332 vars_in_scope [ `div_text-${ id } ` ] = ""
333+ cells_order . push ( `div_text-${ id } ` )
330334
331335 $ ( `textarea#text-box_${ id } ` ) . addClass ( "text-box" )
332336 $ ( `textarea#text-box_${ id } ` ) . val ( md_out )
You can’t perform that action at this time.
0 commit comments