From f1f085671498f205e2eec62ecfe40ee733f8517a 2011-11-29 23:33:38 From: Matthias BUSSONNIER Date: 2011-11-29 23:33:38 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 --- diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index 5ba3474..9bb1f69 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(); }