Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var ViewManager = {
- currentView : null,
- queuedView: null,
- gotoView: function(view) {
- if(this.currentView !== null && this.currentView.cid == view.cid) {
- console.log("same view-die");
- return;
- }
- if(this.currentView !== null && this.currentView.cid != view.cid) {
- console.log("close view and queue");
- this.queuedView = view;
- ViewManager.hideView();
- return;
- }
- this.queuedView = view;
- ViewManager.showView();
- },
- showView: function(){
- this.currentView = this.queuedView;
- this.currentView.show();
- },
- hideView: function(){
- this.currentView.hide();
- },
- onHideView: function(){
- // check if queued, then show that
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement