From 2af468fdc252f03309a10dd83008a1bc462fdbbb Mon Sep 17 00:00:00 2001 From: Thach MAI Date: Sat, 17 Oct 2015 03:27:07 +0200 Subject: [PATCH] Fix #581 by moving the double-click selection focus into MarkdownCell. --- notebook/static/notebook/js/cell.js | 4 ---- notebook/static/notebook/js/textcell.js | 12 ++++++++++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/notebook/static/notebook/js/cell.js b/notebook/static/notebook/js/cell.js index 558039ad9..963a856ec 100644 --- a/notebook/static/notebook/js/cell.js +++ b/notebook/static/notebook/js/cell.js @@ -199,10 +199,6 @@ define([ if (that.selected === false) { this.events.trigger('select.Cell', {'cell':that}); } - var cont = that.unrender(); - if (cont) { - that.focus_editor(); - } }); }; diff --git a/notebook/static/notebook/js/textcell.js b/notebook/static/notebook/js/textcell.js index dc92f7026..e5bde67be 100644 --- a/notebook/static/notebook/js/textcell.js +++ b/notebook/static/notebook/js/textcell.js @@ -298,6 +298,18 @@ define([ return cont; }; + /** @method bind_events **/ + MarkdownCell.prototype.bind_events = function () { + TextCell.prototype.bind_events.apply(this); + var that = this; + + this.element.dblclick(function () { + var cont = that.unrender(); + if (cont) { + that.focus_editor(); + } + }); + }; var RawCell = function (options) { /**