X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/c0e11a8f6d0d9a4c030aa90fe91f0fc49cd05e0e..7e51aac084729ec15edc054e7c0bc3b07be05889:/modules/data.js?ds=sidebyside diff --git a/modules/data.js b/modules/data.js index 5f3fd39..36ba172 100644 --- a/modules/data.js +++ b/modules/data.js @@ -5,8 +5,7 @@ rng.modules.data = function(sandbox) { if(doc === '') { - doc = '\n\ - '; } @@ -52,10 +50,13 @@ rng.modules.data = function(sandbox) { sandbox.publish('documentChanged', doc, reason); }, saveDocument: function() { + sandbox.publish('savingStarted'); $.ajax({ method: 'post', url: '/' + gettext('editor') + '/' + document_id, - data: JSON.stringify({document:doc}) + data: JSON.stringify({document:doc}), + success: function() {sandbox.publish('savingEnded', 'success');}, + error: function() {sandbox.publish('savingEnded', 'error');} }); }