3 Polymer('core-tooltip', {
6 * A simple string label for the tooltip to display. To display a rich
7 * that includes HTML, use the `tip` attribute on the content.
16 * If true, the tooltip an arrow pointing towards the content.
25 * If true, the tooltip displays by default.
34 * Positions the tooltip to the top, right, bottom, left of its content.
42 attached: function() {
46 labelChanged: function(oldVal, newVal) {
47 // Run if we're not after attached().
53 setPosition: function() {
54 var controlWidth = this.clientWidth;
55 var controlHeight = this.clientHeight;
57 var styles = getComputedStyle(this.$.tooltip);
58 var toolTipWidth = parseFloat(styles.width);
59 var toolTipHeight = parseFloat(styles.height);
61 switch (this.position) {
64 this.$.tooltip.style.left = (controlWidth - toolTipWidth) / 2 + 'px';
68 this.$.tooltip.style.top = (controlHeight - toolTipHeight) / 2 + 'px';