-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Workaround some issues with current codelab components making resume …
…not working Prepare a patch to reapply the fix for future use. Fixes #3 Reported upstream as googlecodelabs/codelab-components#36
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Workaround some issues with current codelab components making resume not working | ||
--- bower_components/codelab-components/google-codelab.html 2016-09-28 11:39:55.539253795 +0200 | ||
+++ bower_components/codelab-components/google-codelab-patched.html 2016-09-28 11:39:46.839198581 +0200 | ||
@@ -454,13 +454,21 @@ prevent syntax highlighting code blocks, | ||
// allow everything render and initialize, | ||
// especially this.steps which runs at the same init level | ||
// as iron-localstorage (on attached). | ||
+ | ||
+ // save the stepIndex which is changed afterwards in _selectedChanged when this.steps is restored | ||
+ // this makes the resume functionality not triggered | ||
+ let stepindex = this.state.stepIndex; | ||
this.async(function() { | ||
+ this.state.stepIndex = stepindex; | ||
this._storedStep = this.steps[this.state.stepIndex]; | ||
// resume dialog is shown only when all 3 conditions hold: | ||
// 1. user has already visited the codelab in the past | ||
// 2. has made at least 1 step | ||
// 3. user is landed on the first step | ||
if (this.selected === 0 && this.state.stepIndex > 0) { | ||
+ // Fix stacking issue when background drop are set as first element (due to our outter iron-overlay | ||
+ // creating a new layer) | ||
+ document.body.appendChild(this.$.resumeDialog); | ||
this.$.resumeDialog.open(); | ||
} | ||
}, 500); |