X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/3193141f55df20910cf8ba35f9e669d79c90d3f4..514e98aeae05045d0086aae39960124a572e646f:/platforma/static/js/views/panel_container.js diff --git a/platforma/static/js/views/panel_container.js b/platforma/static/js/views/panel_container.js deleted file mode 100644 index 6dbddd98..00000000 --- a/platforma/static/js/views/panel_container.js +++ /dev/null @@ -1,48 +0,0 @@ -/*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._super(element, model, template); - - $('.panel-main-toolbar select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this)); - $('.panel-main-toolbar .refresh', this.element.get(0)) - .bind('click.panel-container-view', this.refreshButtonClicked.bind(this)) - .attr('disabled', 'disabled'); - }, - - selectChanged: function(event) { - var value = $('select', this.element.get(0)).val(); - var klass = panels[value]; - - if (this.contentView) { - this.contentView.dispose(); - this.contentView = null; - } - - 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); - } - }, - - refreshButtonClicked: function(event) { - if (this.contentView) { - console.log('refreshButtonClicked'); - this.contentView.reload(); - } - }, - - dispose: function() { - $('.panel-main-toolbar .refresh', this.element.get(0)).unbind('click.panel-container-view'); - $('.panel-main-toolbar select', this.element.get(0)).unbind('change.panel-container-view'); - this._super(); - } -}); -