Skip to content

Instantly share code, notes, and snippets.

@pewniak747
Created August 5, 2013 19:31
Show Gist options
  • Select an option

  • Save pewniak747/6158754 to your computer and use it in GitHub Desktop.

Select an option

Save pewniak747/6158754 to your computer and use it in GitHub Desktop.
class MainLayout extends Marionette.Layout
template: -> "<div id='main-region'></div>"
regions:
mainRegion: '#main-region'
# application startup
App.mainLayout = new MainLayout
$("body").html(@mainLayout.render().$el)
# somewhere in a router
App.mainLayout.mainRegion.show(new OtherView) # renders OtherView in html body, closing previous view if exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment