X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/755cace721087441becc6e1f22a3e1eed5bbec32..9186b07ad70787977f5b1e589bf20b7a4beed4c0:/project/static/js/views/panel_container.js diff --git a/project/static/js/views/panel_container.js b/project/static/js/views/panel_container.js index af067a3d..6dbddd98 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -19,6 +19,7 @@ var PanelContainerView = View.extend({ selectChanged: function(event) { var value = $('select', this.element.get(0)).val(); var klass = panels[value]; + if (this.contentView) { this.contentView.dispose(); this.contentView = null; @@ -27,7 +28,7 @@ var PanelContainerView = View.extend({ if( value != 'empty') { this.contentView = new klass($('.content-view', this.element.get(0)), this.model.contentModels[value], this); - $('.panel-main-toolbar .refresh', this.element.get(0)).attr('disabled', null); + $('.panel-main-toolbar .refresh', this.element.get(0)).attr('disabled', null); } },