mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-13 13:17:50 +08:00
Fixed code mirror skipping Markdown cell bug
This commit is contained in:
parent
9fe4bcc817
commit
dbc98b5f69
@ -226,6 +226,10 @@ define([
|
||||
* true = ignore, false = don't ignore.
|
||||
* @method handle_codemirror_keyevent
|
||||
*/
|
||||
|
||||
/* Correction here */
|
||||
|
||||
|
||||
CodeCell.prototype.handle_codemirror_keyevent = function (editor, event) {
|
||||
|
||||
var that = this;
|
||||
|
@ -41,10 +41,7 @@ define([
|
||||
this.config = options.config;
|
||||
|
||||
// we cannot put this as a class key as it has handle to "this".
|
||||
var cm_overwrite_options = {
|
||||
onKeyEvent: $.proxy(this.handle_keyevent,this)
|
||||
};
|
||||
var config = utils.mergeopt(TextCell, this.config, {cm_config:cm_overwrite_options});
|
||||
var config = utils.mergeopt(TextCell, this.config);
|
||||
Cell.apply(this, [{
|
||||
config: config,
|
||||
keyboard_manager: options.keyboard_manager,
|
||||
@ -86,6 +83,7 @@ define([
|
||||
inner_cell.append(this.celltoolbar.element);
|
||||
var input_area = $('<div/>').addClass('input_area');
|
||||
this.code_mirror = new CodeMirror(input_area.get(0), this.cm_config);
|
||||
this.code_mirror.on('keydown', $.proxy(this.handle_keyevent,this))
|
||||
// The tabindex=-1 makes this div focusable.
|
||||
var render_area = $('<div/>').addClass('text_cell_render rendered_html')
|
||||
.attr('tabindex','-1');
|
||||
|
Loading…
x
Reference in New Issue
Block a user