Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom handling of up, down, PgUp and PgDown #48

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions google-codelab.html
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ <h2>Would you like to resume where you left off?</h2>
],

keyBindings: {
'left': 'selectPrevious',
'right': 'selectNext',
'left up pageup': 'selectPrevious',
'right down pagedown': 'selectNext',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the opposite of #29, which was done for a specific and clear reason.
Not sure what re-adding it here solves vertical scrolling issue described in #46.

},

ready: function() {
Expand Down Expand Up @@ -383,19 +383,21 @@ <h2>Would you like to resume where you left off?</h2>
/**
* Advance one step of the codelab.
*/
selectNext: function() {
selectNext: function(e) {
this.$.pages.entryAnimation = 'slide-from-right-animation';
this.$.pages.exitAnimation = 'slide-left-animation';
this.select(this.selected + 1);
e.preventDefault();
},

/**
* Go one step backwards.
*/
selectPrevious: function() {
selectPrevious: function(e) {
this.$.pages.entryAnimation = 'slide-from-left-animation';
this.$.pages.exitAnimation = 'slide-right-animation';
this.select(this.selected - 1);
e.preventDefault();
},

/**
Expand Down