|
23 | 23 | <link rel="import" href="../neon-animation/animations/slide-from-left-animation.html"> |
24 | 24 | <link rel="import" href="../neon-animation/animations/slide-right-animation.html"> |
25 | 25 | <link rel="import" href="../neon-animation/animations/slide-left-animation.html"> |
26 | | -<link rel="import" href="../paper-drawer-panel/paper-drawer-panel.html"> |
27 | | -<link rel="import" href="../paper-scroll-header-panel/paper-scroll-header-panel.html"> |
28 | | -<link rel="import" href="../paper-toolbar/paper-toolbar.html"> |
| 26 | + |
| 27 | +<link rel="import" href="../app-layout/app-header-layout/app-header-layout.html"> |
| 28 | +<link rel="import" href="../app-layout/app-drawer/app-drawer.html"> |
| 29 | +<link rel="import" href="../app-layout/app-drawer-layout/app-drawer-layout.html"> |
29 | 30 | <link rel="import" href="../paper-button/paper-button.html"> |
30 | 31 | <link rel="import" href="../paper-dialog/paper-dialog.html"> |
31 | 32 | <link rel="import" href="../paper-fab/paper-fab.html"> |
|
73 | 74 | on-iron-localstorage-load="_stateLoaded"> |
74 | 75 | </iron-localstorage> |
75 | 76 |
|
76 | | - <paper-drawer-panel id="drawer" narrow="{{_narrow}}" selected="{{currDrawer}}"> |
| 77 | + <app-drawer-layout fullbleed narrow="{{_narrow}}" > |
| 78 | + <app-drawer id="drawer" swipe-open> |
77 | 79 |
|
78 | | - <div drawer class="layout vertical"> |
79 | | - <div title="Time remaining" hidden$="{{!_isPositiveNum(duration)}}" |
80 | | - class="countdown layout horizontal"> |
81 | | - <iron-icon icon="schedule"></iron-icon> <span>{{remaining}}</span> |
82 | | - </div> |
| 80 | + <div class="drawer-content-wrapper layout vertical" style="height:100%"> |
| 81 | + |
| 82 | + <div class="flex" style="overflow: auto;"> |
| 83 | + <div title="Time remaining" hidden$="{{!_isPositiveNum(duration)}}" |
| 84 | + class="countdown layout horizontal"> |
| 85 | + <iron-icon icon="schedule"></iron-icon> <span>[[remaining]]</span> |
| 86 | + </div> |
83 | 87 |
|
84 | | - <paper-menu id="toc" class="flex" selected="{{selected}}" |
85 | | - on-iron-select="_allowCodelabComplete"> |
86 | | - <template is="dom-repeat" items="{{steps}}" strip-whitespace> |
87 | | - <paper-item class$="{{_tocItemClass(selected, index)}}"> |
88 | | - <i>{{item.step}}</i><span>{{item.label}}</span> |
89 | | - </paper-item> |
90 | | - </template> |
91 | | - </paper-menu> |
92 | | - |
93 | | - <div id="metadata"> |
94 | | - <template is="dom-if" if="{{feedbackLink}}" strip-whitespace> |
95 | | - <div id="feedback"> |
| 88 | + <paper-menu id="toc" class="flex" selected="{{selected}}" |
| 89 | + on-iron-select="_allowCodelabComplete"> |
| 90 | + <template is="dom-repeat" items="{{steps}}" strip-whitespace> |
| 91 | + <paper-item class$="{{_tocItemClass(selected, index)}}"> |
| 92 | + <i>{{item.step}}</i><span>{{item.label}}</span> |
| 93 | + </paper-item> |
| 94 | + </template> |
| 95 | + </paper-menu> |
| 96 | + </div> |
| 97 | + |
| 98 | + <div id="metadata"> |
| 99 | + <template is="dom-if" if="{{lastUpdated}}" strip-whitespace> |
| 100 | + <div id="last-updated">Last updated on {{lastUpdated}}.</div> |
| 101 | + </template> |
| 102 | + <div id="feedback" hidden$="[[!feedbackLink]]"> |
96 | 103 | Did you find a mistake? |
97 | 104 | <a target="_blank" href$="{{feedbackLink}}">Please file a bug</a>. |
98 | 105 | </div> |
99 | | - </template> |
| 106 | + </div> |
100 | 107 |
|
101 | | - <template is="dom-if" if="{{lastUpdated}}" strip-whitespace> |
102 | | - <div id="last-updated">Last updated on {{lastUpdated}}.</div> |
103 | | - </template> |
104 | 108 | </div> |
105 | 109 |
|
106 | | - </div> |
| 110 | + </app-drawer> |
107 | 111 |
|
108 | | - <paper-scroll-header-panel id="headerpanel" fixed main> |
109 | | - <paper-toolbar hidden$="[[noToolbar]]"> |
110 | | - <template is="dom-if" if="{{_narrow}}" strip-whitespace> |
111 | | - <paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button> |
112 | | - </template> |
113 | | - <template is="dom-if" if="{{!_narrow}}" strip-whitespace> |
114 | | - <paper-icon-button icon="arrow-back" on-tap="_goToHome"></paper-icon-button> |
115 | | - </template> |
116 | | - <h1 class="title">{{title}}</h1> |
117 | | - <div title="Time remaining" hidden$="{{!_isPositiveNum(duration)}}" |
118 | | - class="countdown layout horizontal"> |
119 | | - <iron-icon icon="schedule"></iron-icon> <span>{{remaining}}</span> |
| 112 | + <app-header-layout fullbleed> |
| 113 | + |
| 114 | + <div id="headerpanel" fixed narrow$="[[_narrow]]"> |
| 115 | + <div id="main-toolbar" hidden$="[[noToolbar]]"> |
| 116 | + <div> |
| 117 | + <template is="dom-if" if="{{_narrow}}" strip-whitespace> |
| 118 | + <paper-icon-button icon="menu" drawer-toggle></paper-icon-button> |
| 119 | + </template> |
| 120 | + <template is="dom-if" if="{{!_narrow}}" strip-whitespace> |
| 121 | + <paper-icon-button icon="arrow-back" on-tap="_goToHome"></paper-icon-button> |
| 122 | + </template> |
| 123 | + </div> |
| 124 | + <h3 class="title">[[title]]</h3> |
| 125 | + <div title="Time remaining" hidden$="{{!_isPositiveNum(duration)}}" |
| 126 | + class="countdown layout horizontal"> |
| 127 | + <iron-icon icon="schedule"></iron-icon> <span>{{remaining}}</span> |
| 128 | + </div> |
120 | 129 | </div> |
121 | | - </paper-toolbar> |
122 | | - |
123 | | - <neon-animated-pages id="pages" selected="{{selected}}" |
124 | | - on-iron-deselect="_onStepLeave" |
125 | | - on-iron-items-changed="_onStepsChanged"> |
126 | | - <content select="google-codelab-step"></content> |
127 | | - </neon-animated-pages> |
128 | | - |
129 | | - </paper-scroll-header-panel> |
130 | | - |
131 | | - </paper-drawer-panel> |
132 | | - |
133 | | - <footer id="controls" hidden$="[[noArrows]]" narrow$="[[_narrow]]"> |
134 | | - <div class="fabs layout horizontal justified"> |
135 | | - <paper-fab raised class="navbutton prevbutton" icon="chevron-left" |
136 | | - on-tap="selectPrevious" |
137 | | - title="Previous step" |
138 | | - disabled$="{{_isFirstStep(selected)}}"> |
139 | | - </paper-fab> |
140 | | - |
141 | | - <div> |
142 | | - <template is="dom-if" if="{{_showNextFab(selected, steps)}}" strip-whitespace> |
143 | | - <paper-fab icon="chevron-right" raised class="navbutton nextbutton" |
144 | | - title="{{_nextFabTitle(selected)}}" |
145 | | - on-tap="selectNext"> |
146 | | - </paper-fab> |
147 | | - </template> |
148 | | - |
149 | | - <template is="dom-if" if="{{_showDoneFab(selected, steps)}}" strip-whitespace> |
150 | | - <paper-fab icon="done" raised class="navbutton donebutton" |
151 | | - on-tap="_goToHome" title="Complete codelab"> |
152 | | - </paper-fab> |
153 | | - </template> |
154 | 130 | </div> |
155 | | - </div> |
156 | | - </footer> |
| 131 | + |
| 132 | + <div id="main-content"> |
| 133 | + |
| 134 | + <neon-animated-pages id="pages" selected="{{selected}}" |
| 135 | + on-iron-deselect="_onStepLeave" |
| 136 | + on-iron-items-changed="_onStepsChanged"> |
| 137 | + <content select="google-codelab-step"></content> |
| 138 | + </neon-animated-pages> |
| 139 | + |
| 140 | + <footer id="controls" hidden$="[[noArrows]]" narrow$="[[_narrow]]"> |
| 141 | + <div class="fabs layout horizontal justified"> |
| 142 | + <paper-fab raised class="navbutton prevbutton" icon="chevron-left" |
| 143 | + on-tap="selectPrevious" |
| 144 | + title="Previous step" |
| 145 | + disabled$="{{_isFirstStep(selected)}}"> |
| 146 | + </paper-fab> |
| 147 | + |
| 148 | + <div> |
| 149 | + <template is="dom-if" if="{{_showNextFab(selected, steps)}}" strip-whitespace> |
| 150 | + <paper-fab icon="chevron-right" raised class="navbutton nextbutton" |
| 151 | + title="{{_nextFabTitle(selected)}}" |
| 152 | + on-tap="selectNext"> |
| 153 | + </paper-fab> |
| 154 | + </template> |
| 155 | + |
| 156 | + <template is="dom-if" if="{{_showDoneFab(selected, steps)}}" strip-whitespace> |
| 157 | + <paper-fab icon="done" raised class="navbutton donebutton" |
| 158 | + on-tap="_goToHome" title="Complete codelab"> |
| 159 | + </paper-fab> |
| 160 | + </template> |
| 161 | + </div> |
| 162 | + </div> |
| 163 | + </footer> |
| 164 | + </div> |
| 165 | + |
| 166 | + </app-header-layout> |
| 167 | + </app-drawer-layout> |
157 | 168 |
|
158 | 169 | <paper-dialog id="resumeDialog" modal> |
159 | 170 | <h2>Would you like to resume where you left off?</h2> |
@@ -469,7 +480,8 @@ <h2>Would you like to resume where you left off?</h2> |
469 | 480 | this.steps.slice(this.selected).forEach(function(item) { |
470 | 481 | remain += (item.duration || 0); |
471 | 482 | }); |
472 | | - this._setRemaining(remain + ' min remaining'); |
| 483 | + var str = this._narrow ? '' : ' remaining'; |
| 484 | + this._setRemaining(remain + ' min' + str); |
473 | 485 | }, |
474 | 486 |
|
475 | 487 | _resume: function() { |
@@ -509,7 +521,7 @@ <h2>Would you like to resume where you left off?</h2> |
509 | 521 | }, |
510 | 522 |
|
511 | 523 | _scrollToTopOfStep: function() { |
512 | | - this.$.headerpanel.scrollToTop(); |
| 524 | + document.body.scrollTop = 0; |
513 | 525 | }, |
514 | 526 |
|
515 | 527 | _isPositiveNum: function(duration) { |
|
0 commit comments