integration wip: saving document
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Thu, 21 Nov 2013 13:22:55 +0000 (14:22 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Mon, 2 Dec 2013 13:50:53 +0000 (14:50 +0100)
src/editor/modules/data/data.js
src/editor/modules/rng/rng.js

index 5e45b26..c9ecf7d 100644 (file)
@@ -66,7 +66,7 @@ return function(sandbox) {
                 $.ajax({
                     method: 'post',
                     url: '/' + gettext('editor') + '/' + document_id,
-                    data: JSON.stringify({document:doc, description: event.data.description}),
+                    data: JSON.stringify({document:wlxmlDocument.toXML(), description: event.data.description}),
                     success: function() {
                         event.success();
                         sandbox.publish('savingEnded', 'success');
@@ -104,7 +104,6 @@ return function(sandbox) {
                     url: '/' + gettext('editor') + '/' + document_id + '/revert',
                     data: JSON.stringify(options),
                     success: function(data) {
-                        doc = data.document;
                         document_version = data.version;
                         reloadHistory();
                         sandbox.publish('documentReverted', data);
index 52aaa51..d4fa434 100644 (file)
@@ -130,7 +130,6 @@ return function(sandbox) {
             views.mainLayout.setView('topPanel', sandbox.getModule('mainBar').getView());
         },
         'cmd.save': function() {
-            synchronizeTab(views.mainTabs.getCurrentSlug());
             sandbox.getModule('data').saveDocument();
         }
     };