Skip to content

Instantly share code, notes, and snippets.

@jeffremer
Created February 5, 2011 01:22
Show Gist options
  • Save jeffremer/812100 to your computer and use it in GitHub Desktop.
Save jeffremer/812100 to your computer and use it in GitHub Desktop.
{
setup: function() {
Wbx.Dispatcher.on('after-dispatch', function(interaction) {
if(interaction.controller != this) {
this.application.toolbar.setLeftButton(
new Wbx.views.Button({
text: 'Back',
scope: this,
handler: function() {
Wbx.dispatch({
controller: Wbx.controllers.getControllerById('template'),
action: 'index',
historyUrl: 'template/index'
});
}
})
);
}
}, this);
},
index: function(interaction) {
this.application.toolbar.setRightButton(new Wbx.views.Button({
text: 'Posts',
scope: this,
handler: function() {
this.application.toolbar.removeRightButton();
Wbx.dispatch({
controller: Wbx.controllers.getControllerById('posts'),
action: 'index',
historyUrl: 'posts/index'
});
}
})
);
this.renderIndex(new Wbx.views.AbstractView({html: 'test'}), interaction);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment