Skip to content

Commit 355de6e

Browse files
authored
Merge pull request jupyter#5 from gutow/Cwithquill
using quill.on to get into edit mode when cell is selected
2 parents 0275f3c + 0c52390 commit 355de6e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

notebook/static/notebook/js/WYSIWYGCell.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,20 @@ define([
151151
*/ theme: 'snow'
152152
});
153153

154-
this.editor.on('focus', function () {
154+
/* this.editor.on('focus', function () {
155155
if(that.keyboard_manager) {
156156
that.keyboard_manager.enable();
157157
}
158158
that.code_mirror.setOption('readOnly', !that.is_editable());
159+
}); */
160+
this.editor.on('editor-change', function (eventName, ...args){
161+
//alert('quill caught a click in the editor');
162+
if (!that.selected) and (eventName == 'selection-change') and
163+
(args[0].length >=0){//we're in the cell
164+
that.events.trigger('select.Cell', {'cell':that});
165+
}
166+
that.events.trigger('edit_mode.Cell', {cell: that});
167+
//if already selected or blurred do nothing.
159168
});
160169
//codemirror monkeypatch overrides on calls from notebook
161170
//

0 commit comments

Comments
 (0)