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

Unified Diff: chrome/browser/resources/md_history/app.js

Issue 2627383002: MD History: Replace app-drawer with cr-drawer (Closed)
Patch Set: Use correct close function Created 3 years, 11 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
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/md_history/app.js
diff --git a/chrome/browser/resources/md_history/app.js b/chrome/browser/resources/md_history/app.js
index 846643fa50a94bd3627ec1acf105b5617048d10b..997b91814de664ea3e5f5b847601518b51d21367 100644
--- a/chrome/browser/resources/md_history/app.js
+++ b/chrome/browser/resources/md_history/app.js
@@ -96,7 +96,10 @@ Polymer({
},
// True if the window is narrow enough for the page to have a drawer.
- hasDrawer_: Boolean,
+ hasDrawer_: {
+ type: Boolean,
+ observer: 'hasDrawerChanged_',
+ },
// Used to display notices for profile sign-in status.
showSidebarFooter: Boolean,
@@ -181,9 +184,9 @@ Polymer({
/** @private */
onCrToolbarMenuTap_: function() {
- var drawer = this.$$('#drawer');
- if (drawer)
- drawer.toggle();
+ var drawer = /** @type {!CrDrawerElement} */ (this.$.drawer.get());
+ drawer.align = document.documentElement.dir == 'ltr' ? 'left' : 'right';
+ drawer.toggle();
},
/**
@@ -357,6 +360,13 @@ Polymer({
this.recordHistoryPageView_();
},
+ /** @private */
+ hasDrawerChanged_: function() {
+ var drawer = /** @type {?CrDrawerElement} */ (this.$.drawer.getIfExists());
+ if (!this.hasDrawer_ && drawer && drawer.open)
+ drawer.closeDrawer();
+ },
+
/**
* This computed binding is needed to make the iron-pages selector update when
* the synced-device-manager is instantiated for the first time. Otherwise the
@@ -373,9 +383,9 @@ Polymer({
/** @private */
closeDrawer_: function() {
- var drawer = this.$$('#drawer');
- if (drawer)
- drawer.close();
+ var drawer = this.$.drawer.get();
+ if (drawer && drawer.open)
+ drawer.closeDrawer();
},
/** @private */
« no previous file with comments | « chrome/browser/resources/md_history/app.html ('k') | chrome/browser/resources/md_history/app.crisper.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698