Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Nov 15, 2015
2 parents 8af4a13 + 2e22c85 commit 102ca93
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
2 changes: 2 additions & 0 deletions codelab-style.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@
}

.navbutton.prevbutton[disabled] {
background: var(--google-codelab-fab-background);
color: white;
transform: scale(0);
}

Expand Down
21 changes: 11 additions & 10 deletions google-codelab.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
on-iron-localstorage-load="_stateLoaded">
</iron-localstorage>

<paper-drawer-panel narrow="{{narrow}}" selected="{{currDrawer}}" id="drawer">
<paper-drawer-panel narrow="{{_narrow}}" selected="{{currDrawer}}" id="drawer">

<div drawer>
<paper-menu id="toc" selected="{{selected}}"
Expand All @@ -88,10 +88,10 @@

<paper-scroll-header-panel id="headerpanel" fixed main>
<paper-toolbar>
<template is="dom-if" if="{{narrow}}">
<template is="dom-if" if="{{_narrow}}">
<paper-icon-button icon="menu" paper-drawer-toggle></paper-icon-button>
</template>
<template is="dom-if" if="{{!narrow}}">
<template is="dom-if" if="{{!_narrow}}">
<paper-icon-button icon="arrow-back" on-tap="_goToHome"></paper-icon-button>
</template>
<h1 class="title">{{title}}</h1>
Expand All @@ -115,14 +115,14 @@ <h1 class="title">{{title}}</h1>
</paper-fab>

<div>
<template is="dom-if" if="{{_hideDoneFab(selected)}}">
<template is="dom-if" if="{{_showNextFab(selected, steps)}}">
<paper-fab icon="chevron-right" raised class="navbutton nextbutton"
title="{{_nextFabTitle(selected)}}"
on-tap="selectNext">
</paper-fab>
</template>

<template is="dom-if" if="{{!_hideDoneFab(selected)}}">
<template is="dom-if" if="{{_showDoneFab(selected, steps)}}">
<paper-fab icon="done" raised class="navbutton donebutton"
on-tap="_goToHome" title="Complete codelab">
</paper-fab>
Expand Down Expand Up @@ -459,13 +459,14 @@ <h2>Would you like to resume where you left off?</h2>
},

_isLastStep: function(stepIndex) {
if (isNaN(stepIndex) || !this.$.pages.items) {
return true;
}
return !this.$.pages.items.length || stepIndex >= this.$.pages.items.length - 1;
return !this.steps.length || stepIndex >= this.steps.length - 1;
},

_showDoneFab: function(stepIndex, steps) {
return this._isLastStep(stepIndex);
},

_hideDoneFab: function(stepIndex) {
_showNextFab: function(stepIndex, steps) {
return !this._isLastStep(stepIndex);
},

Expand Down

0 comments on commit 102ca93

Please sign in to comment.