##// END OF EJS Templates
Make the time before activating a tooltip configurable...
Matthias BUSSONNIER -
Show More
@@ -64,8 +64,11 var IPython = (function (IPython) {
64 // handlers and is used to provide custom key handling. Its return
64 // handlers and is used to provide custom key handling. Its return
65 // value is used to determine if CodeMirror should ignore the event:
65 // value is used to determine if CodeMirror should ignore the event:
66 // true = ignore, false = don't ignore.
66 // true = ignore, false = don't ignore.
67 tooltip_wait_time = 2000;
68
67
68 // note that we are comparing and setting the time to wait at each key press.
69 // a better wqy might be to generate a new function on each time change and
70 // assign it to CodeCell.prototype.request_tooltip_after_time
71 tooltip_wait_time = this.notebook.time_before_tooltip;
69 tooltip_on_tab = this.notebook.tooltip_on_tab;
72 tooltip_on_tab = this.notebook.tooltip_on_tab;
70 var that = this;
73 var that = this;
71
74
@@ -28,6 +28,7 var IPython = (function (IPython) {
28 this.create_elements();
28 this.create_elements();
29 this.bind_events();
29 this.bind_events();
30 this.set_tooltipontab(true);
30 this.set_tooltipontab(true);
31 this.set_timebeforetooltip(1200);
31 };
32 };
32
33
33
34
@@ -622,6 +623,11 var IPython = (function (IPython) {
622 };
623 };
623
624
624
625
626 Notebook.prototype.set_timebeforetooltip = function (time) {
627 console.log("change time before tooltip to : "+time);
628 this.time_before_tooltip = time;
629 };
630
625 Notebook.prototype.set_tooltipontab = function (state) {
631 Notebook.prototype.set_tooltipontab = function (state) {
626 console.log("change tooltip on tab to : "+state);
632 console.log("change tooltip on tab to : "+state);
627 this.tooltip_on_tab = state;
633 this.tooltip_on_tab = state;
@@ -137,6 +137,9 var IPython = (function (IPython) {
137 this.content.find('#tooltipontab').attr('title', 'Show tooltip if yuo press <Tab> after "(" or a white space');
137 this.content.find('#tooltipontab').attr('title', 'Show tooltip if yuo press <Tab> after "(" or a white space');
138 this.content.find('#tooltipontab_label').attr('title', 'Show Tooltip when pressing Tab');
138 this.content.find('#tooltipontab_label').attr('title', 'Show Tooltip when pressing Tab');
139
139
140 this.content.find('#timebeforetooltip').attr('title', 'Time before a tooltip auto-appear when "(" is pressed (negative value supress tooltip)');
141 this.content.find('#timebeforetooltip_label').attr('title', 'Time before a tooltip auto-appear when "(" is pressed (negative value supress tooltip)');
142
140 };
143 };
141
144
142
145
@@ -146,6 +149,10 var IPython = (function (IPython) {
146 var state = $('#tooltipontab').prop('checked');
149 var state = $('#tooltipontab').prop('checked');
147 IPython.notebook.set_tooltipontab(state);
150 IPython.notebook.set_tooltipontab(state);
148 });
151 });
152 this.content.find('#timebeforetooltip').change(function () {
153 var state = $('#timebeforetooltip').prop('value');
154 IPython.notebook.set_timebeforetooltip(state);
155 });
149 };
156 };
150
157
151 // CellSection
158 // CellSection
@@ -262,6 +262,12
262 </span>
262 </span>
263 <span class="checkbox_label" id="tooltipontab_label">Tooltip on tab:</span>
263 <span class="checkbox_label" id="tooltipontab_label">Tooltip on tab:</span>
264 </div>
264 </div>
265 <div class="section_row">
266 <span id="tooltipontab_span">
267 <input type="text" id="timebeforetooltip" value="1200"></input>
268 </span>
269 <span class="numeric_input_label" id="timebeforetooltip_label">Time before tooltip : </span>
270 </div>
265 </div>
271 </div>
266 </div>
272 </div>
267
273
General Comments 0
You need to be logged in to leave comments. Login now