fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Wstępne wykorzystanie modułu logging.
[redakcja.git]
/
project
/
static
/
js
/
views
/
html.js
diff --git
a/project/static/js/views/html.js
b/project/static/js/views/html.js
index
41c3497
..
3d803fc
100644
(file)
--- a/
project/static/js/views/html.js
+++ b/
project/static/js/views/html.js
@@
-11,24
+11,26
@@
var HTMLView = View.extend({
this.model
.addObserver(this, 'data', this.modelDataChanged.bind(this))
this.model
.addObserver(this, 'data', this.modelDataChanged.bind(this))
- .addObserver(this, 's
ynced', this.modelSync
Changed.bind(this));
+ .addObserver(this, 's
tate', this.modelState
Changed.bind(this));
$('.htmlview', this.element).html(this.model.get('data'));
$('.htmlview', this.element).html(this.model.get('data'));
- if (!this.model.get('synced')) {
- this.parent.freeze('Niezsynchronizowany...');
- this.model.load();
- }
+ this.modelStateChanged('state', this.model.get('state'));
+ this.model.load();
},
modelDataChanged: function(property, value) {
$('.htmlview', this.element).html(value);
},
},
modelDataChanged: function(property, value) {
$('.htmlview', this.element).html(value);
},
- modelS
ync
Changed: function(property, value) {
- if (value) {
+ modelS
tate
Changed: function(property, value) {
+ if (value
== 'synced' || value == 'dirty'
) {
this.parent.unfreeze();
this.parent.unfreeze();
- } else {
+ } else
if (value == 'unsynced')
{
this.parent.freeze('Niezsynchronizowany...');
this.parent.freeze('Niezsynchronizowany...');
+ } else if (value == 'loading') {
+ this.parent.freeze('Ładowanie...');
+ } else if (value == 'saving') {
+ this.parent.freeze('Zapisywanie...');
}
},
}
},