From 09eb378dcc608fa00655655eef28f40d964d5130 2014-03-20 23:11:00 From: Jonathan Frederic Date: 2014-03-20 23:11:00 Subject: [PATCH] Move code into is_cell_editor_focused --- diff --git a/IPython/html/tests/notebook/dualmode.js b/IPython/html/tests/notebook/dualmode.js index 830d1f3..ab1d4cf 100644 --- a/IPython/html/tests/notebook/dualmode.js +++ b/IPython/html/tests/notebook/dualmode.js @@ -162,7 +162,13 @@ casper.notebook_test(function () { }; this.is_cell_editor_focused = function(index) { - return this._is_cell_inputfield(index, '.CodeMirror-focused *'); + return this.evaluate(function(i) { + var cell = IPython.notebook.get_cell(i); + if (cell) { + return $(cell.code_mirror.getInputField()).is('.CodeMirror-focused *'); + } + return false; + }, {i : index}); }; this.is_cell_on = function(i, on_class, off_class) { @@ -209,16 +215,6 @@ casper.notebook_test(function () { }, {i : index}); }; - this._is_cell_inputfield = function(index, selector) { - return this.evaluate(function(i, s) { - var cell = IPython.notebook.get_cell(i); - if (cell) { - return $(cell.code_mirror.getInputField()).is(s); - } - return false; - }, {i : index, s: selector}); - }; - this._has_cell_class = function(index, classes) { return this.evaluate(function(i, c) { var cell = IPython.notebook.get_cell(i);