handle null objectname on tooltip

This commit is contained in:
Matthias BUSSONNIER 2011-11-24 19:36:20 +01:00
parent e380aba1e0
commit bc5aeebd11
2 changed files with 13 additions and 8 deletions

View File

@ -171,12 +171,16 @@ var IPython = (function (IPython) {
};
Kernel.prototype.object_info_request = function (objname) {
var content = {
oname : objname.toString(),
};
var msg = this.get_msg("object_info_request", content);
this.shell_channel.send(JSON.stringify(msg));
return msg.header.msg_id;
if(typeof(objname)!=null)
{
var content = {
oname : objname.toString(),
};
var msg = this.get_msg("object_info_request", content);
this.shell_channel.send(JSON.stringify(msg));
return msg.header.msg_id;
}
return;
}
Kernel.prototype.execute = function (code) {

View File

@ -739,7 +739,6 @@ var IPython = (function (IPython) {
Notebook.prototype.handle_payload = function (cell, payload) {
var l = payload.length;
console.log(payload);
for (var i=0; i<l; i++) {
if (payload[i].source === 'IPython.zmq.page.page') {
if (payload[i].text.trim() !== '') {
@ -919,7 +918,9 @@ var IPython = (function (IPython) {
func = func.replace(endBracket,"");
var re = /[a-zA-Z._]+$/g;
var msg_id = this.kernel.object_info_request(re.exec(func));
this.msg_cell_map[msg_id] = cell.cell_id;
if(typeof(msg_id)!='undefined'){
this.msg_cell_map[msg_id] = cell.cell_id;
}
};
Notebook.prototype.complete_cell = function (cell, line, cursor_pos) {