Skip to content

Instantly share code, notes, and snippets.

@alonextou
Created September 5, 2013 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alonextou/6452678 to your computer and use it in GitHub Desktop.
Save alonextou/6452678 to your computer and use it in GitHub Desktop.
App.ApplicationController = Ember.Controller.extend({
observePath: function() {
if (this.get('currentPath') !== 'index') {
$(window).scrollTop(264)
} else {
$(window).scrollTop(0)
}
}.observes('currentPath')
});
App.ApplicationView = Ember.View.extend({
didInsertElement: function() {
$('#menu-affix').affix({
offset: {
top: 264
}
});
if (this.controller.get('currentPath') !== 'index') {
$(window).scrollTop(264)
} else {
$(window).scrollTop(0)
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment