@@ -6,6 +6,14 @@ const editor = CodeMirror(document.getElementById('div-1'), {
66 value : ''
77} ) ;
88
9+ $ ( "#div-1" )
10+ . mouseover ( function ( ) {
11+ $ ( "#btn-actions-1" ) . show ( )
12+ } )
13+ . mouseout ( function ( ) {
14+ $ ( "#btn-actions-1" ) . hide ( )
15+ } ) ;
16+
917
1018//Global Params
1119let vars_in_scope = {
@@ -55,7 +63,7 @@ function add_new_code_cell(c_id, where) {
5563 <p id="cell-num" class="code_symbol">[${ new_id } ]</p>
5664 </div>
5765 <div id="div-${ new_id } " class="col-md-11">
58- <div class="btn-group-horizontal">
66+ <div id="btn-actions- ${ new_id } " class="btn-group-horizontal" style="display: none; ">
5967 <button type="button" id="run_div-${ new_id } " class="btn btn-sm btn-success run"><i
6068 class="fas fa-play"></i>Run</button>
6169 <div class="btn-group" role="group" aria-label="Basic example">
@@ -91,6 +99,7 @@ function add_new_code_cell(c_id, where) {
9199 </div>
92100</div>
93101`
102+
94103 let divReference = document . getElementById ( parent_cell_id ) ;
95104
96105 if ( where == "up" ) {
@@ -108,6 +117,14 @@ function add_new_code_cell(c_id, where) {
108117 } ) ;
109118 vars_in_scope [ `div-${ new_id } ` ] = editor
110119
120+ $ ( `#div-${ new_id } ` )
121+ . mouseover ( function ( ) {
122+ $ ( `#btn-actions-${ new_id } ` ) . show ( )
123+ } )
124+ . mouseout ( function ( ) {
125+ $ ( `#btn-actions-${ new_id } ` ) . hide ( )
126+ } ) ;
127+
111128}
112129
113130function add_new_text_cell ( id , count ) {
@@ -129,6 +146,8 @@ function delete_cell(id) {
129146
130147}
131148
149+
150+
132151$ ( document ) . on ( "click" , "button.run" , function ( ) {
133152 exec_cell ( this . id ) ;
134153} )
0 commit comments