Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(428)

Unified Diff: third_party/polymer/components/paper-tooltip/paper-tooltip.html

Issue 3010683002: Update Polymer components. (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/polymer/components/paper-tooltip/paper-tooltip.html
diff --git a/third_party/polymer/components/paper-tooltip/paper-tooltip.html b/third_party/polymer/components/paper-tooltip/paper-tooltip.html
index 4c2f0391b62ee50f428aabdf0dfd070ab9f67656..670280b17985f5cc2b0b490b15663ebb1f5ce4cc 100644
--- a/third_party/polymer/components/paper-tooltip/paper-tooltip.html
+++ b/third_party/polymer/components/paper-tooltip/paper-tooltip.html
@@ -244,8 +244,20 @@ Custom property | Description | Default
if (this._showing)
return;
- if (Polymer.dom(this).textContent.trim() === '')
- return;
+ if (Polymer.dom(this).textContent.trim() === ''){
+ // Check if effective children are also empty
+ var allChildrenEmpty = true;
+ var effectiveChildren = Polymer.dom(this).getEffectiveChildNodes();
+ for (var i = 0; i < effectiveChildren.length; i++) {
+ if (effectiveChildren[i].textContent.trim() !== '') {
+ allChildrenEmpty = false;
+ break;
+ }
+ }
+ if (allChildrenEmpty) {
+ return;
+ }
+ }
this.cancelAnimation();
@@ -321,8 +333,8 @@ Custom property | Description | Default
// TODO(noms): This should use IronFitBehavior if possible.
if (this.fitToVisibleBounds) {
- // Clip the left/right side.
- if (tooltipLeft + thisRect.width > window.innerWidth) {
+ // Clip the left/right side
+ if (parentRect.left + tooltipLeft + thisRect.width > window.innerWidth) {
this.style.right = '0px';
this.style.left = 'auto';
} else {
@@ -331,11 +343,11 @@ Custom property | Description | Default
}
// Clip the top/bottom side.
- if (tooltipTop + thisRect.height > window.innerHeight) {
- this.style.bottom = '0px';
+ if (parentRect.top + tooltipTop + thisRect.height > window.innerHeight) {
+ this.style.bottom = parentRect.height + 'px';
this.style.top = 'auto';
} else {
- this.style.top = Math.max(0, tooltipTop) + 'px';
+ this.style.top = Math.max(-parentRect.top, tooltipTop) + 'px';
this.style.bottom = 'auto';
}
} else {
« no previous file with comments | « third_party/polymer/components/paper-tooltip/bower.json ('k') | third_party/polymer/components/paper-tooltip/test/basic.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698