1 /*globals Class render_template panels*/
3 var PanelContainerView = Class.extend({
5 template: 'panel-container-view-template',
8 init: function(element, template) {
9 this.element = $(element);
10 this.template = template || this.template;
12 this.element.html(render_template(this.template, {panels: panels}));
13 $('select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this));
16 selectChanged: function(event) {
17 var view = panels[$('select', this.element.get(0)).val()];
18 var klass = view.klass;
19 console.log(view, klass);
20 this.contentView = new klass($('.content-view', this.element.get(0)));
21 console.log(this.contentView);
25 $('select', this.element.get(0)).unbind('change.panel-container-view');