Created
January 4, 2012 18:20
-
-
Save ppcano/1561316 to your computer and use it in GitHub Desktop.
Navigation View ( left to right animation ) with Ember.
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
App.navMainView = Luh.Ui.NavigationMainView.create({ | |
}); | |
App.NavigationView = Luh.Ui.NavigationView.extend({ | |
hasBackBinding: Em.Binding.oneWay('App.navMainView.hasBack'), | |
template: Em.Handlebars.compile('<div id="header">{{#if hasBack}}{{#view App.BackButton class="button bordered back"}}HBack{{/view}}{{/if}}{{#view App.NextButton class="button bordered next"}}Next{{/view}}</div><div id="footer"></div>') | |
}); | |
App.navMainView.appendTo('#nav_main_container'); | |
var view = App.NavigationView.create({ | |
classNames: ['bg_green'] | |
}); | |
App.navMainView.pushView( view ); | |
App.BackButton = Em.View.extend(Luh.Ui.bTap, { | |
bTap: function() { | |
App.navMainView.popView(); | |
} | |
}); | |
App.NextButton = Em.View.extend(Luh.Ui.bTap, { | |
bTap: function() { | |
var view = App.NavigationView.create({ | |
classNames: ['bg_black'] | |
}); | |
App.navMainView.pushView(view); | |
} | |
}); | |
App.backButton = App.BackButton.create({}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment