##// END OF EJS Templates
call tooltip after time
Matthias BUSSONNIER -
Show More
@@ -60,9 +60,7 b' var IPython = (function (IPython) {'
60 // don't do anything if line beggin with '(' or is empty
60 // don't do anything if line beggin with '(' or is empty
61 } else {
61 } else {
62 // Will set a timer to request tooltip in `time`
62 // Will set a timer to request tooltip in `time`
63 that.tooltip_timeout = setTimeout(function(){
63 IPython.tooltip.pending(that, pre_cursor)
64 IPython.tooltip.request(that, pre_cursor)
65 },time);
66 }
64 }
67 };
65 };
68
66
@@ -118,13 +118,18 b' var IPython = (function (IPython) {'
118 // note that we don't handle closing directly inside the calltip
118 // note that we don't handle closing directly inside the calltip
119 // as in the completer, because it is not focusable, so won't
119 // as in the completer, because it is not focusable, so won't
120 // get the event.
120 // get the event.
121 this.hide();
121 this.hide();
122 if (this.tooltip_timeout != null){
122 if (this.tooltip_timeout != null){
123 clearTimeout(this.tooltip_timeout);
123 clearTimeout(this.tooltip_timeout);
124 this.tooltip_timeout = null;
124 this.tooltip_timeout = null;
125 }
125 }
126 }
126 }
127
127
128 Tooltip.prototype.pending = function(cell,text)
129 {
130 var that = this;
131 this.timeout = setTimeout(function(){that.request(cell, text)} , IPython.notebook.time_before_tooltip);
132 }
128 Tooltip.prototype.request = function(cell,text)
133 Tooltip.prototype.request = function(cell,text)
129 {
134 {
130 IPython.notebook.request_tool_tip(cell, text);
135 IPython.notebook.request_tool_tip(cell, text);
General Comments 0
You need to be logged in to leave comments. Login now