Permalink
Browse files

Merge pull request #147 from boazsender/146-uselayoutopts

Adds options handling to  in app.js
  • Loading branch information...
2 parents 516487c + 5594b23 commit 17e8ea99797c0efa3215161b9f942dd46918bd43 @tbranyen committed Aug 29, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 app/app.js
View
@@ -60,7 +60,7 @@ function($, _, Backbone) {
},
// Helper for using layouts.
- useLayout: function(name) {
+ useLayout: function(name, options) {
// If already using this Layout, then don't re-inject into the DOM.
if (this.layout && this.layout.options.template === name) {
return this.layout;
@@ -71,12 +71,12 @@ function($, _, Backbone) {
this.layout.remove();
}
- // Create a new Layout.
- var layout = new Backbone.Layout({
+ // Create a new Layout with options.
+ var layout = new Backbone.Layout(_.extend({
template: name,
className: "layout " + name,
id: "layout"
- });
+ }, options));
// Insert into the DOM.
$("#main").empty().append(layout.el);

0 comments on commit 17e8ea9

Please sign in to comment.