From 90b6f1b8d6e14186159b73d40ed3826f11f1cb2b Mon Sep 17 00:00:00 2001 From: Matthias BUSSONNIER Date: Wed, 30 Nov 2011 00:31:58 +0100 Subject: [PATCH] fix double tooltip there was a possibility of 2 tooltip if clicking in two cell and one that it wasn't able to dismiss --- IPython/frontend/html/notebook/static/js/codecell.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 5ba34745b..9bb1f6914 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -73,8 +73,8 @@ var IPython = (function (IPython) { var that = this; // whatever key is pressed, first, cancel the tooltip request before // they are sent, and remove tooltip if any - if(event.type === 'keydown' && this.tooltip_timeout != null){ - CodeCell.prototype.remove_and_cancell_tooltip(that.tooltip_timeout); + if(event.type === 'keydown' ){ + CodeCell.prototype.remove_and_cancel_tooltip(that.tooltip_timeout); that.tooltip_timeout=null; } @@ -145,12 +145,13 @@ var IPython = (function (IPython) { return false; }; - CodeCell.prototype.remove_and_cancell_tooltip = function(timeout) + CodeCell.prototype.remove_and_cancel_tooltip = function(timeout) { // note that we don't handle closing directly inside the calltip // as in the completer, because it is not focusable, so won't // get the event. - clearTimeout(timeout); + if(timeout != null) + { clearTimeout(timeout);} $('#tooltip').remove(); }