Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
risenW committed Aug 24, 2020
2 parents 22ef41d + e902476 commit 3979dd5
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion dnotebook/src/public/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,27 @@ $(document).on("click", "button.run", function () {
* Deletes a cell on button delete click
*/
$(document).on("click", "button.del", function () {
let id = this.id.split("_")[1]
let id_split = this.id.split("_")
let id = id_split[1]
let btn_type = id_split[0].split("-")[1]

if(btn_type =="text"){

let div_scope = `div_text-${id}`
let md_scope = `text-div_${id}`

delete md_texts[md_scope]
delete vars_in_scope[div_scope]

let cell_index = cells_order.indexOf(div_scope)
cells_order.splice(cell_index,1)
}else{
let div_scope = `div-${id}`
delete vars_in_scope[div_scope]

let cell_index = cells_order.indexOf(div_scope)
cells_order.splice(cell_index,1)
}
delete_cell(id)
})

Expand Down

0 comments on commit 3979dd5

Please sign in to comment.