##// END OF EJS Templates
Only call CM.focus() if CM is not already focused.
Brian E. Granger -
Show More
@@ -288,8 +288,16 b' var IPython = (function (IPython) {'
288 * @method focus_editor
288 * @method focus_editor
289 */
289 */
290 Cell.prototype.focus_editor = function () {
290 Cell.prototype.focus_editor = function () {
291 var that = this;
291 this.refresh();
292 this.refresh();
292 this.code_mirror.focus();
293 // Only focus the CM editor if it is not focused already. This prevents jumps
294 // related to the previous prompt position.
295 setTimeout(function () {
296 var isf = IPython.utils.is_focused;
297 if (!isf(that.element.find('div.CodeMirror'))) {
298 this.code_mirror.focus();
299 }
300 }, 1);
293 }
301 }
294
302
295 /**
303 /**
General Comments 0
You need to be logged in to leave comments. Login now