X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e823ad27e90d5cba05fb2ea8ac2a0d258be2f707..f46d9319a26b5cf74fcf5aa24a5a8df18f1bda74:/project/static/js/views/panel_container.js?ds=sidebyside diff --git a/project/static/js/views/panel_container.js b/project/static/js/views/panel_container.js index e4950ba8..332e83a6 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -1,17 +1,15 @@ /*globals View render_template panels*/ var PanelContainerView = View.extend({ + _className: 'PanelContainerView', element: null, model: null, template: 'panel-container-view-template', contentView: null, init: function(element, model, template) { - this.element = $(element); - this.model = model; - this.template = template || this.template; - - this.element.html(render_template(this.template, {panels: panels})); + this._super(element, model, template); + $('select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this)); }, @@ -23,7 +21,7 @@ var PanelContainerView = View.extend({ this.contentView = null; } this.contentView = new klass($('.content-view', - this.element.get(0)), this.model.contentModels[value]); + this.element.get(0)), this.model.contentModels[value], this); }, dispose: function() {