1 /*globals View render_template panels*/
3 var PanelContainerView = View.extend({
4 _className: 'PanelContainerView',
7 template: 'panel-container-view-template',
10 init: function(element, model, template) {
11 this._super(element, model, template);
13 $('select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this));
16 selectChanged: function(event) {
17 var value = $('select', this.element.get(0)).val();
18 var klass = panels[value];
19 if (this.contentView) {
20 this.contentView.dispose();
21 this.contentView = null;
23 this.contentView = new klass($('.content-view',
24 this.element.get(0)), this.model.contentModels[value], this);
28 $('select', this.element.get(0)).unbind('change.panel-container-view');