You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
651 B
JavaScript
27 lines
651 B
JavaScript
10 years ago
|
define([
|
||
|
'underscore',
|
||
|
'marionette',
|
||
|
'core/layout/view',
|
||
|
'core/layout/model'
|
||
|
], function LayoutModuleDefine(_, Marionette, LayoutView, LayoutModel) {
|
||
|
'use strict';
|
||
|
|
||
|
var LayoutModule = Marionette.Module.extend({
|
||
|
Model: LayoutModel,
|
||
|
View: LayoutView,
|
||
|
|
||
|
onStart: function(options) {
|
||
|
var opts = _.defaults({}, options || {}, {layout: {}});
|
||
|
_.defaults(opts.layout, {view: {}, model: {}});
|
||
|
|
||
|
var config = opts.layout;
|
||
|
this.model = new this.Model(config.model);
|
||
|
config.view.model = this.model;
|
||
|
this.view = new this.View(config.view);
|
||
|
this.view.render();
|
||
|
}
|
||
|
});
|
||
|
|
||
|
return LayoutModule;
|
||
|
});
|