Make the time before activating a tooltip configurable

add a section in the left pannel of the notebook to make the time before
	triggering a tooltip when pressign "(" configurable.  Negative values will
	disable the tooltip (comparaison at each keypress for now, but can be
	improved) The syle of the <input> field should be a little improve, why not
	a slider with jquerry
Matthias BUSSONNIER 15 years ago
parent 6c86474bdb
commit 2637d3c0e4

@ -64,8 +64,11 @@ var IPython = (function (IPython) {
// handlers and is used to provide custom key handling. Its return
// value is used to determine if CodeMirror should ignore the event:
// true = ignore, false = don't ignore.
tooltip_wait_time = 2000;
// note that we are comparing and setting the time to wait at each key press.
// a better wqy might be to generate a new function on each time change and
// assign it to CodeCell.prototype.request_tooltip_after_time
tooltip_wait_time = this.notebook.time_before_tooltip;
tooltip_on_tab = this.notebook.tooltip_on_tab;
var that = this;

@ -28,6 +28,7 @@ var IPython = (function (IPython) {
this.create_elements();
this.bind_events();
this.set_tooltipontab(true);
this.set_timebeforetooltip(1200);
};
@ -622,6 +623,11 @@ var IPython = (function (IPython) {
};
Notebook.prototype.set_timebeforetooltip = function (time) {
console.log("change time before tooltip to : "+time);
this.time_before_tooltip = time;
};
Notebook.prototype.set_tooltipontab = function (state) {
console.log("change tooltip on tab to : "+state);
this.tooltip_on_tab = state;

@ -262,6 +262,12 @@
</span>
<span class="checkbox_label" id="tooltipontab_label">Tooltip on tab:</span>
</div>
<div class="section_row">
<span id="tooltipontab_span">
<input type="text" id="timebeforetooltip" value="1200"></input>
</span>
<span class="numeric_input_label" id="timebeforetooltip_label">Time before tooltip : </span>
</div>
</div>
</div>

Loading…
Cancel
Save