##// END OF EJS Templates
move arow with tooltip positoin
Matthias BUSSONNIER -
Show More
@@ -97,7 +97,7
97 background-image: linear-gradient(center bottom, #d7d7d7 13%, #d2d2d2 39%, #e3e3e3 56%, #f7f7f7 91%);
97 background-image: linear-gradient(center bottom, #d7d7d7 13%, #d2d2d2 39%, #e3e3e3 56%, #f7f7f7 91%);
98 overflow: visible;
98 overflow: visible;
99 color: #000000;
99 color: #000000;
100 border-color: #bbbbbb;
100 border: #bbbbbb 1px solid;
101 outline: none;
101 outline: none;
102 padding: 3px;
102 padding: 3px;
103 margin: 0px;
103 margin: 0px;
@@ -108,16 +108,16
108 }
108 }
109 .pretooltiparrow {
109 .pretooltiparrow {
110 left: 0px;
110 left: 0px;
111 margin-left: 0px;
111 margin: 0px;
112 top: -16px;
112 top: -16px;
113 width: 70px;
113 width: 40px;
114 height: 16px;
114 height: 16px;
115 overflow: hidden;
115 overflow: hidden;
116 position: absolute;
116 position: absolute;
117 }
117 }
118 .pretooltiparrow:before {
118 .pretooltiparrow:before {
119 background-color: #f7f7f7;
119 background-color: #f7f7f7;
120 border: thin silver solid ;
120 border: 1px #bbbbbb solid;
121 z-index: 11;
121 z-index: 11;
122 content: "";
122 content: "";
123 position: absolute;
123 position: absolute;
@@ -49,12 +49,12 var IPython = (function (IPython) {
49 //setTimeout(function(){that.code_mirror.focus();}, 50);
49 //setTimeout(function(){that.code_mirror.focus();}, 50);
50 })
50 })
51 .append(
51 .append(
52 $('<span/>').text('Expand')
52 $('<span/>').text('Expand')
53 .addClass('ui-icon')
53 .addClass('ui-icon')
54 .addClass('ui-icon-plus')
54 .addClass('ui-icon-plus')
55 );
55 );
56
56
57 // open in pager
57 // open in pager
58 var morelink=$('<a/>').attr('href',"#")
58 var morelink=$('<a/>').attr('href',"#")
59 .attr('role',"button")
59 .attr('role',"button")
60 .addClass('ui-button');
60 .addClass('ui-button');
@@ -69,7 +69,7 var IPython = (function (IPython) {
69 setTimeout(function(){that.code_mirror.focus();}, 50);
69 setTimeout(function(){that.code_mirror.focus();}, 50);
70 });
70 });
71
71
72 // close the tooltip
72 // close the tooltip
73 var closelink=$('<a/>').attr('href',"#");
73 var closelink=$('<a/>').attr('href',"#");
74 closelink.attr('role',"button");
74 closelink.attr('role',"button");
75 closelink.addClass('ui-button');
75 closelink.addClass('ui-button');
@@ -78,21 +78,21 var IPython = (function (IPython) {
78 closespan.addClass('ui-icon-close');
78 closespan.addClass('ui-icon-close');
79 closelink.append(closespan);
79 closelink.append(closespan);
80 closelink.click(function(){
80 closelink.click(function(){
81 that.hide();
81 that.hide();
82 });
82 });
83
83
84 //construct the tooltip
84 //construct the tooltip
85 // add in the reverse order you want them to appear
85 // add in the reverse order you want them to appear
86 this.buttons.append(closelink);
86 this.buttons.append(closelink);
87 this.buttons.append(expandlink);
87 this.buttons.append(expandlink);
88 this.buttons.append(morelink);
88 this.buttons.append(morelink);
89
89
90 // we need a phony element to make the small arrow
90 // we need a phony element to make the small arrow
91 // of the tooltip in css
91 // of the tooltip in css
92 // we could try to move the arrow later
92 // we could try to move the arrow later
93 arrow = $('<div/>').addClass('pretooltiparrow');
93 this.arrow = $('<div/>').addClass('pretooltiparrow');
94 this.tooltip.append(arrow);
95 this.tooltip.append(this.buttons);
94 this.tooltip.append(this.buttons);
95 this.tooltip.append(this.arrow);
96 this.tooltip.append(this.text);
96 this.tooltip.append(this.text);
97 };
97 };
98
98
@@ -129,14 +129,20 var IPython = (function (IPython) {
129 {
129 {
130 // move the bubble if it is not hidden
130 // move the bubble if it is not hidden
131 // otherwise fade it
131 // otherwise fade it
132 var xinit = pos.x;
133 var xinter = xinit/1000*600;
134 var posarrowleft = xinit - xinter;
135
136
132 if( this._hidden == false)
137 if( this._hidden == false)
133 {
138 {
134 this.tooltip.animate({'left' : pos.x-30+'px','top' :(pos.yBot+10)+'px'});
139 this.tooltip.animate({'left' : xinter-30+'px','top' :(pos.yBot+10)+'px'});
135 } else
140 } else
136 {
141 {
137 this.tooltip.css({'left' : pos.x-30+'px'});
142 this.tooltip.css({'left' : xinter-30+'px'});
138 this.tooltip.css({'top' :(pos.yBot+10)+'px'});
143 this.tooltip.css({'top' :(pos.yBot+10)+'px'});
139 }
144 }
145 this.arrow.animate({'left' : posarrowleft+'px'});
140 this.tooltip.removeClass('hidden')
146 this.tooltip.removeClass('hidden')
141 this.tooltip.removeClass('hide');
147 this.tooltip.removeClass('hide');
142 this._hidden = false;
148 this._hidden = false;
@@ -23,6 +23,7
23 @c3 : rgb(227,227,227);
23 @c3 : rgb(227,227,227);
24 @c4 : rgb(247,247,247);
24 @c4 : rgb(247,247,247);
25 @bordercolor : #BBB;
25 @bordercolor : #BBB;
26 @borderwidth : 1px;
26 @textColor : #000;
27 @textColor : #000;
27
28
28 @-moz-keyframes fadeOut {
29 @-moz-keyframes fadeOut {
@@ -102,10 +103,10
102 }
103 }
103
104
104 .tooltip {
105 .tooltip {
105 -webkit-transition: all 0.8s ease;
106 -webkit-transition: all 0.8s ease;
106 -moz-transition: all 0.8s ease;
107 -moz-transition: all 0.8s ease;
107 -ms-transition: all 0.8s ease;
108 -ms-transition: all 0.8s ease;
108 -o-transition: all 0.8s ease;
109 -o-transition: all 0.8s ease;
109 /*transition when "expand"ing tooltip */
110 /*transition when "expand"ing tooltip */
110 -webkit-transition-property: height;
111 -webkit-transition-property: height;
111 -webkit-transition-duration: 1s;
112 -webkit-transition-duration: 1s;
@@ -128,7 +129,7
128 .linearGradient(13%,@c1, 39%, @c2 , 56%,@c3, 91% , @c4) ;
129 .linearGradient(13%,@c1, 39%, @c2 , 56%,@c3, 91% , @c4) ;
129 overflow : visible;
130 overflow : visible;
130 color: @textColor;
131 color: @textColor;
131 border-color: @bordercolor;
132 border: @bordercolor @borderwidth solid;
132 outline: none;
133 outline: none;
133 padding: 3px;
134 padding: 3px;
134 margin: 0px;
135 margin: 0px;
@@ -141,9 +142,9
141
142
142 .pretooltiparrow {
143 .pretooltiparrow {
143 left: 0px;
144 left: 0px;
144 margin-left: 0px;
145 margin: 0px;
145 top: -16px;
146 top: -16px;
146 width: 70px;
147 width: 40px;
147 height: 16px;
148 height: 16px;
148 overflow: hidden;
149 overflow: hidden;
149 position: absolute;
150 position: absolute;
@@ -151,7 +152,7
151 }
152 }
152 .pretooltiparrow:before {
153 .pretooltiparrow:before {
153 background-color : @c4;
154 background-color : @c4;
154 border : thin silver solid ;
155 border : @borderwidth @bordercolor solid;
155 z-index:11;
156 z-index:11;
156 content: "";
157 content: "";
157 position: absolute;
158 position: absolute;
General Comments 0
You need to be logged in to leave comments. Login now