Skip to content

Commit

Permalink
#6137 add commenting feature to newly created cells
Browse files Browse the repository at this point in the history
  • Loading branch information
Mariusz Jurowicz committed Oct 13, 2017
1 parent 2481e15 commit 7506422
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions beakerx/js/src/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,15 @@ define([
}
});
});

Jupyter.notebook.get_cells().map(function(cell, i) {
if (cell.cell_type === 'code'){
setCodeMirrorLineComment(cell.code_mirror);
}
});
});
Jupyter.notebook.events.on('kernel_interrupting.Kernel', function() {
interrupt();
});
Jupyter.notebook.get_cells().map(function(cell, i) {
if (cell.cell_type === 'code'){
setCodeMirrorLineComment(cell.code_mirror);
}
});
}

installKernelHandler();
Expand Down Expand Up @@ -326,6 +325,9 @@ define([
callback_notebook_loaded();
}
events.on('notebook_loaded.Notebook', callback_notebook_loaded);
events.on('create.Cell', function(data, cell) {
setCodeMirrorLineComment(cell.cell.code_mirror);
});
}).catch(function (reason) {
console.error(log_prefix, 'unhandled error:', reason);
});
Expand Down

0 comments on commit 7506422

Please sign in to comment.