fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix error with revision check during saving.
[redakcja.git]
/
src
/
redakcja
/
static
/
js
/
wiki
/
wikiapi.js
diff --git
a/src/redakcja/static/js/wiki/wikiapi.js
b/src/redakcja/static/js/wiki/wikiapi.js
index
4a28d63
..
73642ac
100644
(file)
--- a/
src/redakcja/static/js/wiki/wikiapi.js
+++ b/
src/redakcja/static/js/wiki/wikiapi.js
@@
-126,6
+126,7
@@
this.fullUri = $("*[data-key='full-uri']", meta).text();
this.text = null;
this.fullUri = $("*[data-key='full-uri']", meta).text();
this.text = null;
+ this.saving = false;
this.has_local_changes = false;
this.active = new Date();
this._lock = -1;
this.has_local_changes = false;
this.active = new Date();
this._lock = -1;
@@
-217,6
+218,7
@@
/* this doesn't modify anything, so no locks */
var self = this;
let active = new Date() - self.active < 30 * 1000;
/* this doesn't modify anything, so no locks */
var self = this;
let active = new Date() - self.active < 30 * 1000;
+ let saving = self.saving;
$.ajax({
method: "GET",
url: reverse("ajax_document_rev", self.id),
$.ajax({
method: "GET",
url: reverse("ajax_document_rev", self.id),
@@
-247,7
+249,7
@@
});
$("#people").html(people);
});
$("#people").html(people);
- if (
data.rev != self.revision
) {
+ if (
!saving && (data.rev != self.revision)
) {
params.outdated();
}
}
params.outdated();
}
}
@@
-375,6
+377,7
@@
data['textsave-text'] = self.text;
data['textsave-text'] = self.text;
+ self.saving = true;
$.ajax({
url: reverse("ajax_document_text", self.id),
type: "POST",
$.ajax({
url: reverse("ajax_document_text", self.id),
type: "POST",
@@
-392,10
+395,12
@@
changed = true;
self.triggerDocumentChanged();
};
changed = true;
self.triggerDocumentChanged();
};
+ self.saving = false;
params['success'](self, changed, ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna"));
},
error: function(xhr) {
params['success'](self, changed, ((changed && "Udało się zapisać :)") || "Twoja wersja i serwera jest identyczna"));
},
error: function(xhr) {
+ self.saving = false;
if ($('#header').hasClass('saving')) {
$('#header').removeClass('saving');
$.blockUI({
if ($('#header').hasClass('saving')) {
$('#header').removeClass('saving');
$.blockUI({