##// 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 return true;
179 return true;
180 };
180 };
181 } else if (event.which === key.ESC) {
181 } else if (event.which === key.ESC) {
182 if (!IPython.tooltip._hidden) {
182 return IPython.tooltip.remove_and_cancel_tooltip(true);
183 IPython.tooltip.remove_and_cancel_tooltip(true);
184 return true;
185 } else {
186 return false;
187 }
188 } else if (event.which === key.DOWNARROW && event.type === 'keydown') {
183 } else if (event.which === key.DOWNARROW && event.type === 'keydown') {
189 // If we are not at the bottom, let CM handle the down arrow and
184 // If we are not at the bottom, let CM handle the down arrow and
190 // prevent the global keydown handler from handling it.
185 // prevent the global keydown handler from handling it.
@@ -161,16 +161,23 var IPython = (function (IPython) {
161 this.code_mirror = null;
161 this.code_mirror = null;
162 }
162 }
163
163
164 // return true on successfully removing a visible tooltip; otherwise return
165 // false.
164 Tooltip.prototype.remove_and_cancel_tooltip = function (force) {
166 Tooltip.prototype.remove_and_cancel_tooltip = function (force) {
165 // note that we don't handle closing directly inside the calltip
167 // note that we don't handle closing directly inside the calltip
166 // as in the completer, because it is not focusable, so won't
168 // as in the completer, because it is not focusable, so won't
167 // get the event.
169 // get the event.
170 if (this._hidden === false) {
168 if (this._sticky == false || force == true) {
171 if (this._sticky == false || force == true) {
169 this.cancel_stick();
172 this.cancel_stick();
170 this._hide();
173 this._hide();
171 }
174 }
172 this.cancel_pending();
175 this.cancel_pending();
173 this.reset_tabs_function();
176 this.reset_tabs_function();
177 return true;
178 } else {
179 return false;
180 }
174 }
181 }
175
182
176 // cancel autocall done after '(' for example.
183 // cancel autocall done after '(' for example.
General Comments 0
You need to be logged in to leave comments. Login now