From 9a96182c20b31868159f4ddd25bbb46abc4173e3 Mon Sep 17 00:00:00 2001 From: zuber Date: Thu, 1 Oct 2009 15:22:11 +0200 Subject: [PATCH] =?utf8?q?Dzia=C5=82aj=C4=85cy=20przycisk=20"Od=C5=9Bwie?= =?utf8?q?=C5=BC=20panel"=20(reload)=20:-)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- project/static/js/models.js | 12 ++++++------ project/static/js/views/html.js | 4 +++- project/static/js/views/panel_container.js | 1 + project/static/js/views/xml.js | 4 +++- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/project/static/js/models.js b/project/static/js/models.js index c333a976..65b9d67b 100644 --- a/project/static/js/models.js +++ b/project/static/js/models.js @@ -56,8 +56,8 @@ Editor.XMLModel = Editor.Model.extend({ this.addObserver(this, 'data', this.dataChanged.bind(this)); }, - load: function() { - if (this.get('state') == 'empty') { + load: function(force) { + if (force || this.get('state') == 'empty') { this.set('state', 'loading'); $.ajax({ url: this.serverURL, @@ -162,8 +162,8 @@ Editor.HTMLModel = Editor.Model.extend({ this.serverURL = serverURL; }, - load: function() { - if (this.get('state') == 'empty') { + load: function(force) { + if (force || this.get('state') == 'empty') { this.set('state', 'loading'); $.ajax({ url: this.serverURL, @@ -215,8 +215,8 @@ Editor.ImageGalleryModel = Editor.Model.extend({ this.pages = []; }, - load: function() { - if (this.get('state') == 'empty') { + load: function(force) { + if (force || this.get('state') == 'empty') { this.set('state', 'loading'); $.ajax({ url: this.serverURL, diff --git a/project/static/js/views/html.js b/project/static/js/views/html.js index 8057138e..a7f02dd4 100644 --- a/project/static/js/views/html.js +++ b/project/static/js/views/html.js @@ -36,7 +36,9 @@ var HTMLView = View.extend({ } }, - reload: function() {}, + reload: function() { + this.model.load(true); + }, dispose: function() { this.model.removeObserver(this); diff --git a/project/static/js/views/panel_container.js b/project/static/js/views/panel_container.js index aead0e77..8d383e1a 100644 --- a/project/static/js/views/panel_container.js +++ b/project/static/js/views/panel_container.js @@ -30,6 +30,7 @@ var PanelContainerView = View.extend({ refreshButtonClicked: function(event) { if (this.contentView) { + console.log('refreshButtonClicked'); this.contentView.reload(); } }, diff --git a/project/static/js/views/xml.js b/project/static/js/views/xml.js index 20e2ee98..caafa715 100644 --- a/project/static/js/views/xml.js +++ b/project/static/js/views/xml.js @@ -35,7 +35,9 @@ var XMLView = View.extend({ $('.xmlview', this.element).height(height); }, - reload: function() {}, + reload: function() { + this.model.load(true); + }, editorDidLoad: function(editor) { $(editor.frame).css({width: '100%', height: '100%'}); -- 2.20.1