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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-light-extracted.js

Issue 1862213002: Roll third_party/polymer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove obsolete appearance_browsertest.js, result of a previous bad merge. Created 4 years, 8 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/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-light-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-light-extracted.js
similarity index 88%
copy from third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js
copy to third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-light-extracted.js
index 0a41ece722c0d60a8a3267e6f110af0b1919c433..4fa6d1879adc268a377b43201ae6cc994dc9a1d1 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-dropdown-menu/paper-dropdown-menu-light-extracted.js
@@ -2,23 +2,12 @@
'use strict';
Polymer({
- is: 'paper-dropdown-menu',
-
- /**
- * Fired when the dropdown opens.
- *
- * @event paper-dropdown-open
- */
-
- /**
- * Fired when the dropdown closes.
- *
- * @event paper-dropdown-close
- */
+ is: 'paper-dropdown-menu-light',
behaviors: [
Polymer.IronButtonState,
Polymer.IronControlState,
+ Polymer.PaperRippleBehavior,
Polymer.IronFormElementBehavior,
Polymer.IronValidatableBehavior
],
@@ -56,7 +45,8 @@
value: {
type: String,
notify: true,
- readOnly: true
+ readOnly: true,
+ observer: '_valueChanged',
},
/**
@@ -74,13 +64,6 @@
},
/**
- * The error message to display when invalid.
- */
- errorMessage: {
- type: String
- },
-
- /**
* True if the dropdown is open. Otherwise, false.
*/
opened: {
@@ -134,6 +117,11 @@
verticalAlign: {
type: String,
value: 'top'
+ },
+
+ hasContent: {
+ type: Boolean,
+ readOnly: true
}
},
@@ -267,6 +255,31 @@
if (e) {
e.setAttribute('aria-expanded', openState);
}
- }
+ },
+
+ _computeLabelClass: function(noLabelFloat, alwaysFloatLabel, hasContent) {
+ var cls = '';
+ if (noLabelFloat === true) {
+ return hasContent ? 'label-is-hidden' : '';
+ }
+
+ if (hasContent || alwaysFloatLabel === true) {
+ cls += ' label-is-floating';
+ }
+ return cls;
+ },
+
+ _valueChanged: function() {
+ // Only update if it's actually different.
+ if (this.$.input && this.$.input.textContent !== this.value) {
+ this.$.input.textContent = this.value;
+ }
+
+ if (this.value || this.value === 0 || this.value === false) {
+ this._setHasContent(true);
+ } else {
+ this._setHasContent(false);
+ }
+ },
});
})();

Powered by Google App Engine
This is Rietveld 408576698