X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/9490c431ea46a6c3d9f1d348a5b525c0bd3b6359..dba809feb44cd1c4d155f3e3254a1cca5323f95f:/project/static/js/views/panel_container.js?ds=inline diff --git a/project/static/js/views/panel_container.js b/project/static/js/views/panel_container.js index c8735744..e4950ba8 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -16,15 +16,14 @@ var PanelContainerView = View.extend({ }, selectChanged: function(event) { - var view = panels[$('select', this.element.get(0)).val()]; - var klass = view.klass; - console.log(view, klass); + var value = $('select', this.element.get(0)).val(); + var klass = panels[value]; if (this.contentView) { this.contentView.dispose(); this.contentView = null; } - this.contentView = new klass($('.content-view', this.element.get(0)), this.model); - console.log(this.contentView); + this.contentView = new klass($('.content-view', + this.element.get(0)), this.model.contentModels[value]); }, dispose: function() {