Skip to content

Commit

Permalink
Merge pull request jupyter#5 from gutow/Cwithquill
Browse files Browse the repository at this point in the history
using quill.on to get into edit mode when cell is selected
  • Loading branch information
ColinGutow authored Jul 4, 2019
2 parents 0275f3c + 0c52390 commit 355de6e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion notebook/static/notebook/js/WYSIWYGCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,20 @@ define([
*/ theme: 'snow'
});

this.editor.on('focus', function () {
/* this.editor.on('focus', function () {
if(that.keyboard_manager) {
that.keyboard_manager.enable();
}
that.code_mirror.setOption('readOnly', !that.is_editable());
}); */
this.editor.on('editor-change', function (eventName, ...args){
//alert('quill caught a click in the editor');
if (!that.selected) and (eventName == 'selection-change') and
(args[0].length >=0){//we're in the cell
that.events.trigger('select.Cell', {'cell':that});
}
that.events.trigger('edit_mode.Cell', {cell: that});
//if already selected or blurred do nothing.
});
//codemirror monkeypatch overrides on calls from notebook
//
Expand Down

0 comments on commit 355de6e

Please sign in to comment.