diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js
index 50241d9..147c16c 100644
--- a/IPython/frontend/html/notebook/static/js/codecell.js
+++ b/IPython/frontend/html/notebook/static/js/codecell.js
@@ -60,9 +60,7 @@ var IPython = (function (IPython) {
// don't do anything if line beggin with '(' or is empty
} else {
// Will set a timer to request tooltip in `time`
- that.tooltip_timeout = setTimeout(function(){
- IPython.tooltip.request(that, pre_cursor)
- },time);
+ IPython.tooltip.pending(that, pre_cursor)
}
};
diff --git a/IPython/frontend/html/notebook/static/js/tooltip.js b/IPython/frontend/html/notebook/static/js/tooltip.js
index de88531..7b90b92 100644
--- a/IPython/frontend/html/notebook/static/js/tooltip.js
+++ b/IPython/frontend/html/notebook/static/js/tooltip.js
@@ -118,13 +118,18 @@ var IPython = (function (IPython) {
// 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.
- this.hide();
+ this.hide();
if (this.tooltip_timeout != null){
clearTimeout(this.tooltip_timeout);
this.tooltip_timeout = null;
}
}
-
+
+ Tooltip.prototype.pending = function(cell,text)
+ {
+ var that = this;
+ this.timeout = setTimeout(function(){that.request(cell, text)} , IPython.notebook.time_before_tooltip);
+ }
Tooltip.prototype.request = function(cell,text)
{
IPython.notebook.request_tool_tip(cell, text);