Created
November 30, 2012 08:04
-
-
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?
This file contains hidden or 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
// 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