Index: third_party/polymer/v1_0/components-chromium/paper-tooltip/paper-tooltip-extracted.js |
diff --git a/third_party/polymer/v1_0/components-chromium/paper-tooltip/paper-tooltip-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-tooltip/paper-tooltip-extracted.js |
index 7946ae48b46d315f1c8bd0df467fc86ef37d3901..ed84ac2f51a755320f4281e4f0868f7fa50f525c 100644 |
--- a/third_party/polymer/v1_0/components-chromium/paper-tooltip/paper-tooltip-extracted.js |
+++ b/third_party/polymer/v1_0/components-chromium/paper-tooltip/paper-tooltip-extracted.js |
@@ -21,6 +21,15 @@ Polymer({ |
}, |
/** |
+ * Set this to true if you want to manually control when the tooltip |
+ * is shown or hidden. |
+ */ |
+ manualMode: { |
+ type: Boolean, |
+ value: false |
+ }, |
+ |
+ /** |
* Positions the tooltip to the top, right, bottom, left of its content. |
*/ |
position: { |
@@ -122,6 +131,9 @@ Polymer({ |
attached: function() { |
this._target = this.target; |
+ if (this.manualMode) |
+ return; |
+ |
this.listen(this._target, 'mouseenter', 'show'); |
this.listen(this._target, 'focus', 'show'); |
this.listen(this._target, 'mouseleave', 'hide'); |
@@ -130,7 +142,7 @@ Polymer({ |
}, |
detached: function() { |
- if (this._target) { |
+ if (this._target && !this.manualMode) { |
this.unlisten(this._target, 'mouseenter', 'show'); |
this.unlisten(this._target, 'focus', 'show'); |
this.unlisten(this._target, 'mouseleave', 'hide'); |
@@ -183,7 +195,7 @@ Polymer({ |
}, |
updatePosition: function() { |
- if (!this._target) |
+ if (!this._target || !this.offsetParent) |
return; |
var offset = this.offset; |