fnp
/
redakcja.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a3a778e
)
Działający przycisk "Odśwież panel" (reload) :-)
author
zuber
<marek@stepniowski.com>
Thu, 1 Oct 2009 13:22:11 +0000
(15:22 +0200)
committer
zuber
<marek@stepniowski.com>
Thu, 1 Oct 2009 13:22:11 +0000
(15:22 +0200)
project/static/js/models.js
patch
|
blob
|
history
project/static/js/views/html.js
patch
|
blob
|
history
project/static/js/views/panel_container.js
patch
|
blob
|
history
project/static/js/views/xml.js
patch
|
blob
|
history
diff --git
a/project/static/js/models.js
b/project/static/js/models.js
index
c333a97
..
65b9d67
100644
(file)
--- 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));
},
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,
this.set('state', 'loading');
$.ajax({
url: this.serverURL,
@@
-162,8
+162,8
@@
Editor.HTMLModel = Editor.Model.extend({
this.serverURL = serverURL;
},
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,
this.set('state', 'loading');
$.ajax({
url: this.serverURL,
@@
-215,8
+215,8
@@
Editor.ImageGalleryModel = Editor.Model.extend({
this.pages = [];
},
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,
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
8057138
..
a7f02dd
100644
(file)
--- 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);
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
aead0e7
..
8d383e1
100644
(file)
--- 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) {
refreshButtonClicked: function(event) {
if (this.contentView) {
+ console.log('refreshButtonClicked');
this.contentView.reload();
}
},
this.contentView.reload();
}
},
diff --git
a/project/static/js/views/xml.js
b/project/static/js/views/xml.js
index
20e2ee9
..
caafa71
100644
(file)
--- 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);
},
$('.xmlview', this.element).height(height);
},
- reload: function() {},
+ reload: function() {
+ this.model.load(true);
+ },
editorDidLoad: function(editor) {
$(editor.frame).css({width: '100%', height: '100%'});
editorDidLoad: function(editor) {
$(editor.frame).css({width: '100%', height: '100%'});