Skip to content

Instantly share code, notes, and snippets.

@paulkoegel
Created November 30, 2012 08:04
Show Gist options
  • Save paulkoegel/4174433 to your computer and use it in GitHub Desktop.
Save paulkoegel/4174433 to your computer and use it in GitHub Desktop.
Is there a way to define Marionette subregions like this? Wouldn't this be cool?
// SCENARIO: i have an overview page with several regions.
// when clicking on an item, an overlay is opened (overview remains in the DOM).
// the overlay has several Marionette regions as well (article intro, article body,
// related articles, its own footer)
// QUESTION: wouldn't it be cool to render views by calling myApp.overlay.mainContent(new ArticleView())?
myApp.addRegions({
overview: {
el: '#overview',
regions: {
mainContent: '#overview-content',
sidebar: '#overview-sidebar',
footer: '#overview-footer'
}
}
overlay: {
el: '#overlay',
regions: {
intro: '#overlay-intro',
body: '#overlay-body',
related: '#overlay-related',
footer: '#overlay-footer'
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment