##// END OF EJS Templates
Merge pull request #7055 from foogunlana/codemirror_bug_fix...
Matthias Bussonnier -
r19100:ead33abc merge
parent child Browse files
Show More
@@ -226,6 +226,7 define([
226 * true = ignore, false = don't ignore.
226 * true = ignore, false = don't ignore.
227 * @method handle_codemirror_keyevent
227 * @method handle_codemirror_keyevent
228 */
228 */
229
229 CodeCell.prototype.handle_codemirror_keyevent = function (editor, event) {
230 CodeCell.prototype.handle_codemirror_keyevent = function (editor, event) {
230
231
231 var that = this;
232 var that = this;
@@ -41,10 +41,7 define([
41 this.config = options.config;
41 this.config = options.config;
42
42
43 // we cannot put this as a class key as it has handle to "this".
43 // we cannot put this as a class key as it has handle to "this".
44 var cm_overwrite_options = {
44 var config = utils.mergeopt(TextCell, this.config);
45 onKeyEvent: $.proxy(this.handle_keyevent,this)
46 };
47 var config = utils.mergeopt(TextCell, this.config, {cm_config:cm_overwrite_options});
48 Cell.apply(this, [{
45 Cell.apply(this, [{
49 config: config,
46 config: config,
50 keyboard_manager: options.keyboard_manager,
47 keyboard_manager: options.keyboard_manager,
@@ -86,6 +83,7 define([
86 inner_cell.append(this.celltoolbar.element);
83 inner_cell.append(this.celltoolbar.element);
87 var input_area = $('<div/>').addClass('input_area');
84 var input_area = $('<div/>').addClass('input_area');
88 this.code_mirror = new CodeMirror(input_area.get(0), this.cm_config);
85 this.code_mirror = new CodeMirror(input_area.get(0), this.cm_config);
86 this.code_mirror.on('keydown', $.proxy(this.handle_keyevent,this))
89 // The tabindex=-1 makes this div focusable.
87 // The tabindex=-1 makes this div focusable.
90 var render_area = $('<div/>').addClass('text_cell_render rendered_html')
88 var render_area = $('<div/>').addClass('text_cell_render rendered_html')
91 .attr('tabindex','-1');
89 .attr('tabindex','-1');
General Comments 0
You need to be logged in to leave comments. Login now