fnp
/
fnpeditor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9255c2f
)
update document summary on save/revert
author
Jan Szejko
<janek37@gmail.com>
Fri, 10 Mar 2017 12:35:22 +0000
(13:35 +0100)
committer
Jan Szejko
<janek37@gmail.com>
Fri, 10 Mar 2017 12:35:22 +0000
(13:35 +0100)
src/editor/modules/data/data.js
patch
|
blob
|
history
diff --git
a/src/editor/modules/data/data.js
b/src/editor/modules/data/data.js
index
54c4c17
..
919ce68
100644
(file)
--- a/
src/editor/modules/data/data.js
+++ b/
src/editor/modules/data/data.js
@@
-201,16
+201,18
@@
return function(sandbox) {
method: 'post',
url: sandbox.getConfig().documentSaveUrl(data.document_id),
data: formData,
method: 'post',
url: sandbox.getConfig().documentSaveUrl(data.document_id),
data: formData,
- success: function(data) {
+ success: function(
ajax_
data) {
event.success();
event.success();
- sandbox.publish('savingEnded', 'success', 'remote', data);
+ sandbox.publish('savingEnded', 'success', 'remote',
ajax_
data);
- Object.keys(data)
+ Object.keys(
ajax_
data)
.filter(function(key) {
return key !== 'text';
})
.forEach(function(key) {
.filter(function(key) {
return key !== 'text';
})
.forEach(function(key) {
- wlxmlDocument.setProperty(key, data[key]);
+ wlxmlDocument.setProperty(key, ajax_data[key]);
+ // ugly, but whatever
+ data[key] = ajax_data[key];
});
reloadHistory();
});
reloadHistory();
@@
-275,18
+277,20
@@
return function(sandbox) {
dataType: 'json',
url: sandbox.getConfig().documentRestoreUrl(data.document_id),
data: formData,
dataType: 'json',
url: sandbox.getConfig().documentRestoreUrl(data.document_id),
data: formData,
- success: function(data) {
- Object.keys(data)
+ success: function(
ajax_
data) {
+ Object.keys(
ajax_
data)
.filter(function(key) {
return key !== 'document';
})
.forEach(function(key) {
.filter(function(key) {
return key !== 'document';
})
.forEach(function(key) {
- wlxmlDocument.setProperty(key, data[key]);
+ wlxmlDocument.setProperty(key, ajax_data[key]);
+ // ugly, but whatever
+ data[key] = ajax_data[key];
});
reloadHistory();
});
reloadHistory();
- wlxmlDocument.loadXML(data.document);
+ wlxmlDocument.loadXML(
ajax_
data.document);
documentDirty = false;
documentDirty = false;
- sandbox.publish('documentReverted', data.version);
+ sandbox.publish('documentReverted',
ajax_
data.version);
event.success();
},
});
event.success();
},
});