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

Unified Diff: third_party/polymer/v1_0/components-chromium/app-layout/app-drawer-layout/app-drawer-layout-extracted.js

Issue 2074813002: Roll Polymer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chromium.patch Created 4 years, 6 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/app-layout/app-drawer-layout/app-drawer-layout-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/app-layout/app-drawer-layout/app-drawer-layout-extracted.js b/third_party/polymer/v1_0/components-chromium/app-layout/app-drawer-layout/app-drawer-layout-extracted.js
index e303e94855a2460d4811c14ef5c232d90650ca78..c92731f79decdb43c5aac8ba44ba0f7782ea2b01 100644
--- a/third_party/polymer/v1_0/components-chromium/app-layout/app-drawer-layout/app-drawer-layout-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/app-layout/app-drawer-layout/app-drawer-layout-extracted.js
@@ -15,15 +15,23 @@ Polymer({
},
/**
- * If the viewport's width is smaller than this value, the panel will change to narrow layout.
- * In the mode the drawer will be closed.
+ * If the viewport's width is smaller than this value, the panel will change to narrow
+ * layout. In the mode the drawer will be closed.
*/
responsiveWidth: {
type: String,
value: '640px'
},
- _narrow: Boolean
+ /**
+ * Returns true if it is in narrow layout. This is useful if you need to show/hide
+ * elements based on the layout.
+ */
+ narrow: {
+ type: Boolean,
+ readOnly: true,
+ notify: true
+ }
},
listeners: {
@@ -32,7 +40,7 @@ Polymer({
},
observers: [
- 'resetLayout(_narrow, isAttached)'
+ 'resetLayout(narrow, isAttached)'
],
/**
@@ -61,7 +69,7 @@ Polymer({
var drawerWidth = this.drawer.getWidth();
var contentContainer = this.$.contentContainer;
- if (this._narrow) {
+ if (this.narrow) {
drawer.opened = drawer.persistent = false;
contentContainer.classList.add('narrow');
@@ -84,6 +92,10 @@ Polymer({
});
},
+ _onQueryMatchesChanged: function(event) {
+ this._setNarrow(event.detail.value);
+ },
+
_computeMediaQuery: function(forceNarrow, responsiveWidth) {
return forceNarrow ? '(min-width: 0px)' : '(max-width: ' + responsiveWidth + ')';
}

Powered by Google App Engine
This is Rietveld 408576698