Skip to content

Instantly share code, notes, and snippets.

@nelstrom
Created August 22, 2016 16:45
Show Gist options
  • Save nelstrom/350f148e8e0d3e9b849ec2b904cadd1a to your computer and use it in GitHub Desktop.
Save nelstrom/350f148e8e0d3e9b849ec2b904cadd1a to your computer and use it in GitHub Desktop.
export default Ember.Service.extend({
// ...
lastOpenField() {
...
},
nextOpenField() {
...
},
scrollToNextOpenField() {
let lastField = this.lastOpenField()
let nextField = this.nextOpenField()
finish($(lastField), 'label').then(() => {
let offset = $(`#${match}`).offset().top;
$('html,body').animate({
scrollTop: offset
});
});
},
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment