Show More
@@ -18,17 +18,22 var IPython = (function (IPython) { | |||
|
18 | 18 | |
|
19 | 19 | var Tooltip = function (notebook) { |
|
20 | 20 | this.tooltip = $('#tooltip'); |
|
21 | ||
|
22 | // contain the button in the upper right corner | |
|
21 | 23 | this.buttons = $('<div/>') |
|
22 | 24 | .addClass('tooltipbuttons'); |
|
25 | ||
|
26 | // will contain the docstring | |
|
23 | 27 | this.text = $('<div/>') |
|
24 | 28 | .addClass('tooltiptext') |
|
25 | 29 | .addClass('smalltooltip'); |
|
26 | this.tooltip.css('left',50+'px'); | |
|
27 | this.tooltip.css('top',50+'px'); | |
|
28 | 30 | |
|
29 | 31 | var tooltip = this.tooltip; |
|
30 | 32 | var text = this.text; |
|
31 | 33 | |
|
34 | // build the buttons menu on the upper right | |
|
35 | ||
|
36 | // expand the tooltip to see more | |
|
32 | 37 |
|
|
33 | 38 | .addClass('ui-icon') |
|
34 | 39 | .addClass('ui-icon-plus'); |
@@ -44,11 +49,10 var IPython = (function (IPython) { | |||
|
44 | 49 | //setTimeout(function(){that.code_mirror.focus();}, 50); |
|
45 | 50 | }); |
|
46 | 51 | |
|
52 | // open in pager | |
|
47 | 53 | var morelink=$('<a/>').attr('href',"#"); |
|
48 | 54 | morelink.attr('role',"button"); |
|
49 | 55 | morelink.addClass('ui-button'); |
|
50 | //morelink.addClass("ui-corner-all"); //rounded corner | |
|
51 | //morelink.addClass('ui-state-default'); | |
|
52 | 56 | var morespan=$('<span/>').text('Open in Pager'); |
|
53 | 57 | morespan.addClass('ui-icon'); |
|
54 | 58 | morespan.addClass('ui-icon-arrowstop-l-n'); |
@@ -60,11 +64,10 var IPython = (function (IPython) { | |||
|
60 | 64 | setTimeout(function(){that.code_mirror.focus();}, 50); |
|
61 | 65 | }); |
|
62 | 66 | |
|
67 | // close the tooltip | |
|
63 | 68 | var closelink=$('<a/>').attr('href',"#"); |
|
64 | 69 | closelink.attr('role',"button"); |
|
65 | 70 | closelink.addClass('ui-button'); |
|
66 | //closelink.addClass("ui-corner-all"); //rounded corner | |
|
67 | //closelink.adClass('ui-state-default'); // grey background and blue cross | |
|
68 | 71 | var closespan=$('<span/>').text('Close'); |
|
69 | 72 | closespan.addClass('ui-icon'); |
|
70 | 73 | closespan.addClass('ui-icon-close'); |
@@ -72,15 +75,19 var IPython = (function (IPython) { | |||
|
72 | 75 | closelink.click(function(){ |
|
73 | 76 | tooltip.addClass('hide'); |
|
74 | 77 | }); |
|
78 | ||
|
75 | 79 |
|
|
80 | // add in the reverse order you want them to appear | |
|
76 | 81 | this.buttons.append(closelink); |
|
77 | 82 | this.buttons.append(expandlink); |
|
78 | 83 | this.buttons.append(morelink); |
|
79 | 84 | |
|
85 | // we need a phony element to make the small arrow | |
|
86 | // of the tooltip in css | |
|
87 | // we could try to move the arrow later | |
|
80 | 88 | arrow = $('<div/>').addClass('pretooltiparrow'); |
|
81 | 89 | this.tooltip.append(arrow); |
|
82 | 90 | this.tooltip.append(this.buttons); |
|
83 | this.tooltip.append(this.buttons); | |
|
84 | 91 | this.tooltip.append(this.text); |
|
85 | 92 | }; |
|
86 | 93 |
General Comments 0
You need to be logged in to leave comments.
Login now