##// END OF EJS Templates
Have remove_and_cancel_tooltip() return a boolean
Takeshi Kanmae -
Show More
@@ -179,12 +179,7 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 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.
170 if (this._hidden === false) {
168 171 if (this._sticky == false || force == true) {
169 172 this.cancel_stick();
170 173 this._hide();
171 174 }
172 175 this.cancel_pending();
173 176 this.reset_tabs_function();
177 return true;
178 } else {
179 return false;
180 }
174 181 }
175 182
176 183 // cancel autocall done after '(' for example.
General Comments 0
You need to be logged in to leave comments. Login now