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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js

Issue 1468623004: Update Polymer from 1.2.1 -> 1.2.3 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@travis-yml
Patch Set: local-state.html Created 5 years, 1 month 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/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
index 731dd48a26d4902f9d511201126a876f672b60a2..420007d41bc6308811cd4a71441f33ae9da5b0bb 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-input/paper-input-container-extracted.js
@@ -142,21 +142,6 @@ Polymer({
} else {
this._handleValue(this._inputElement);
}
-
- this._numberOfPrefixNodes = 0;
- this._prefixObserver = Polymer.dom(this.$.prefix).observeNodes(
- function(mutations) {
- // Keep track whether there's at least one prefix node, since it
- // affects laying out the floating label.
- this._numberOfPrefixNodes += mutations.addedNodes.length -
- mutations.removedNodes.length;
- }.bind(this));
- },
-
- detached: function() {
- if (this._prefixObserver) {
- Polymer.dom(this.$.prefix).unobserveNodes(this._prefixObserver);
- }
},
_onAddonAttached: function(event) {
@@ -248,16 +233,15 @@ Polymer({
if (alwaysFloatLabel || _inputHasContent) {
cls += ' label-is-floating';
+ // If the label is floating, ignore any offsets that may have been
+ // applied from a prefix element.
+ this.$.labelAndInputContainer.style.position = 'static';
+
if (invalid) {
cls += ' is-invalid';
} else if (focused) {
cls += " label-is-highlighted";
}
- // If a prefix element exists, the label has a horizontal offset
- // which needs to be undone when displayed as a floating label.
- if (this._numberOfPrefixNodes > 0) {
- this.$.labelAndInputContainer.style.position = 'static';
- }
} else {
// When the label is not floating, it should overlap the input element.
if (label) {

Powered by Google App Engine
This is Rietveld 408576698