##// END OF EJS Templates
Have remove_and_cancel_tooltip() return a boolean
Takeshi Kanmae -
Show More
@@ -179,12 +179,7 b' var IPython = (function (IPython) {'
179 179 return true;
180 180 };
181 181 } else if (event.which === key.ESC) {
182 if (!IPython.tooltip._hidden) {
183 IPython.tooltip.remove_and_cancel_tooltip(true);
184 return true;
185 } else {
186 return false;
187 }
182 return IPython.tooltip.remove_and_cancel_tooltip(true);
188 183 } else if (event.which === key.DOWNARROW && event.type === 'keydown') {
189 184 // If we are not at the bottom, let CM handle the down arrow and
190 185 // prevent the global keydown handler from handling it.
@@ -161,16 +161,23 b' var IPython = (function (IPython) {'
161 161 this.code_mirror = null;
162 162 }
163 163
164 // return true on successfully removing a visible tooltip; otherwise return
165 // false.
164 166 Tooltip.prototype.remove_and_cancel_tooltip = function (force) {
165 167 // note that we don't handle closing directly inside the calltip
166 168 // as in the completer, because it is not focusable, so won't
167 169 // get the event.
168 if (this._sticky == false || force == true) {
169 this.cancel_stick();
170 this._hide();
170 if (this._hidden === false) {
171 if (this._sticky == false || force == true) {
172 this.cancel_stick();
173 this._hide();
174 }
175 this.cancel_pending();
176 this.reset_tabs_function();
177 return true;
178 } else {
179 return false;
171 180 }
172 this.cancel_pending();
173 this.reset_tabs_function();
174 181 }
175 182
176 183 // cancel autocall done after '(' for example.
@@ -335,7 +342,7 b' var IPython = (function (IPython) {'
335 342 if (docstring == null) {
336 343 docstring = reply.docstring;
337 344 }
338
345
339 346 if (docstring == null) {
340 347 // For reals this time, no docstring
341 348 if (this._hide_if_no_docstring) {
General Comments 0
You need to be logged in to leave comments. Login now