File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
dnotebook/src/public/javascripts Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,6 @@ $("#import-notebook-file").change(() => {
447447 }
448448 reader . readAsText ( content ) ;
449449 }
450- $ ( "#uploadNoteModal" ) . modal ( 'hide' ) ;
451450} )
452451
453452
Original file line number Diff line number Diff line change 365365
366366 $ ( `textarea#text-box_${ id } ` ) . addClass ( "text-box" )
367367 $ ( `textarea#text-box_${ id } ` ) . val ( md_out )
368- // update_text_box_size()
368+ update_text_box_size ( )
369369
370370 $ ( `#text-div_${ id } ` )
371371 . mouseover ( function ( ) {
381381 }
382382 }
383383
384-
384+
385+
386+ /**
387+ * Helper function to update text box size dynamically
388+ */
389+ function update_text_box_size ( ) {
390+ $ ( 'textarea' ) . each ( function ( ) {
391+ this . setAttribute ( 'style' , 'height:' + ( this . scrollHeight ) + 'px;overflow-y:hidden;' ) ;
392+ } ) . on ( 'input' , function ( ) {
393+ this . style . height = 'auto' ;
394+ this . style . height = ( this . scrollHeight ) + 'px' ;
395+ } ) ;
396+ }
397+
398+
385399 /**
386400 * Helper function to easily log output from for loops in Dom
387401 * @param {* } args
401415 global . notebook_json = notebook_json
402416 global . load_notebook = load_notebook
403417 global . load_package = load_package
404- global . load_data = load_csv
418+ global . load_csv = load_csv
405419 global . table = table
406420
407421} ) ( window )
You can’t perform that action at this time.
0 commit comments