diff --git a/IPython/frontend/html/notebook/static/js/codecell.js b/IPython/frontend/html/notebook/static/js/codecell.js index cfd497301..38ed22dd3 100644 --- a/IPython/frontend/html/notebook/static/js/codecell.js +++ b/IPython/frontend/html/notebook/static/js/codecell.js @@ -153,7 +153,10 @@ var IPython = (function (IPython) { $('#tooltip').remove(); } - CodeCell.prototype.finish_tooltip = function (defstring,docstring) { + CodeCell.prototype.finish_tooltip = function (reply) { + defstring=reply.definition; + docstring=reply.docstring; + name=reply.name; shortened = function(string){ if(string.length > 200){ return string.trim().substring(0,197)+'...'; @@ -166,7 +169,25 @@ var IPython = (function (IPython) { defstring_html= $('
').html(utils.fixConsole(defstring)); tooltip.append(defstring_html); } - tooltip.append($('').html(utils.fixConsole(shortened(docstring)))); + var pre=$('').html(utils.fixConsole(shortened(docstring))); + var more=$('').text('more...') + more.addClass('ui-button ui-state-default ui-corner-all'); + more.click(function(){ + var msg_id = IPython.notebook.kernel.execute(name+"?"); + IPython.notebook.msg_cell_map[msg_id] = IPython.notebook.selected_cell().cell_id; + CodeCell.prototype.remove_and_cancell_tooltip(that.tooltip_timeout); + setTimeout(function(){that.code_mirror.focus();}, 50); + }); + + var close=$('').text('close') + close.addClass('ui-button ui-state-default ui-corner-all'); + close.click(function(){ + CodeCell.prototype.remove_and_cancell_tooltip(that.tooltip_timeout); + setTimeout(function(){that.code_mirror.focus();}, 50); + }); + pre.append(more); + pre.append(close); + tooltip.append(pre); var pos = this.code_mirror.cursorCoords(); tooltip.css('left',pos.x+'px'); tooltip.css('top',pos.yBot+'px'); diff --git a/IPython/frontend/html/notebook/static/js/notebook.js b/IPython/frontend/html/notebook/static/js/notebook.js index 7702a22ca..f824e97d7 100644 --- a/IPython/frontend/html/notebook/static/js/notebook.js +++ b/IPython/frontend/html/notebook/static/js/notebook.js @@ -723,7 +723,7 @@ var IPython = (function (IPython) { rep = reply.content; if(rep.found) { - cell.finish_tooltip(rep.definition,rep.docstring); + cell.finish_tooltip(rep); } } else { //console.log("unknown reply:"+msg_type);