Skip to content

Commit 3979dd5

Browse files
committed
2 parents 22ef41d + e902476 commit 3979dd5

File tree

1 file changed

+21
-1
lines changed
  • dnotebook/src/public/javascripts

1 file changed

+21
-1
lines changed

dnotebook/src/public/javascripts/index.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,27 @@ $(document).on("click", "button.run", function () {
327327
* Deletes a cell on button delete click
328328
*/
329329
$(document).on("click", "button.del", function () {
330-
let id = this.id.split("_")[1]
330+
let id_split = this.id.split("_")
331+
let id = id_split[1]
332+
let btn_type = id_split[0].split("-")[1]
333+
334+
if(btn_type =="text"){
335+
336+
let div_scope = `div_text-${id}`
337+
let md_scope = `text-div_${id}`
338+
339+
delete md_texts[md_scope]
340+
delete vars_in_scope[div_scope]
341+
342+
let cell_index = cells_order.indexOf(div_scope)
343+
cells_order.splice(cell_index,1)
344+
}else{
345+
let div_scope = `div-${id}`
346+
delete vars_in_scope[div_scope]
347+
348+
let cell_index = cells_order.indexOf(div_scope)
349+
cells_order.splice(cell_index,1)
350+
}
331351
delete_cell(id)
332352
})
333353

0 commit comments

Comments
 (0)