@@ -7,13 +7,10 @@ import 'package:angular/angular.dart';
7
7
@NgDirective (
8
8
selector: '[tooltip]' ,
9
9
map: const {
10
- 'tooltip' : '=>displayModel'
10
+ 'tooltip' : '=>displayModel'
11
11
}
12
12
)
13
13
class Tooltip {
14
- // not sure which one I will need.
15
- // ng-click uses node.
16
- // ng-show-hide uses element.
17
14
dom.Element element;
18
15
dom.Node node;
19
16
Scope scope;
@@ -54,23 +51,23 @@ class Tooltip {
54
51
..borderRadius = "5px"
55
52
..width = "${displayModel .imgWidth .toString ()}px" ;
56
53
57
- // find the coordinates of the parent DOM element
54
+ // find the coordinates of the parent DOM element
58
55
Rectangle bounds = element.getBoundingClientRect ();
59
56
int left = (bounds.left + dom.window.pageXOffset).toInt ();
60
57
int top = (bounds.top + dom.window.pageYOffset).toInt ();
61
58
int width = bounds.width.toInt ();
62
59
int height = bounds.height.toInt ();
63
60
64
- // position the tooltip.
65
- // Figure out where the containing element sits in the window.
61
+ // position the tooltip.
62
+ // Figure out where the containing element sits in the window.
66
63
tooltipElem.style
67
64
..position = "absolute"
68
65
..top = "${top - height }px"
69
66
..left = "${left + width + 10 }px" ;
70
67
71
- // Add the tooltip to the document body. We add it here because
72
- // we need to position it absolutely, without reference to its
73
- // parent element.
68
+ // Add the tooltip to the document body. We add it here because
69
+ // we need to position it absolutely, without reference to its
70
+ // parent element.
74
71
dom.document.body.append (tooltipElem);
75
72
}
76
73
0 commit comments