X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ca6c176908d9de318600355c92860ea489b4b3a1..a3a778ec7c2fe89c4cb48f42be3b0821530199d8:/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 332e83a6..aead0e77 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -10,7 +10,10 @@ var PanelContainerView = View.extend({ init: function(element, model, template) { this._super(element, model, template); - $('select', this.element.get(0)).bind('change.panel-container-view', this.selectChanged.bind(this)); + $('.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) { @@ -22,10 +25,18 @@ var PanelContainerView = View.extend({ } 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) { + this.contentView.reload(); + } }, dispose: function() { - $('select', this.element.get(0)).unbind('change.panel-container-view'); + $('.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(); } });