From 646b269da2387582531258d14a3f2ff550617323 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Tue, 14 Feb 2012 11:45:57 -0800 Subject: Cleaning up mediator --- js/controllers/document-controller.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/document-controller.js b/js/controllers/document-controller.js index 84b994ce..7d38c600 100755 --- a/js/controllers/document-controller.js +++ b/js/controllers/document-controller.js @@ -104,16 +104,26 @@ DocumentController = exports.DocumentController = Montage.create(Component, { handleExecuteSave: { value: function(event) { //Text and HTML document classes should return the same save object for fileSave - this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.clearDocumentDirtyFlag.bind(this)); + this.application.ninja.ioMediator.fileSave(this.activeDocument.save(), this.fileSaveResult.bind(this)); } }, - + //////////////////////////////////////////////////////////////////// + // + fileSaveResult: { + value: function (result) { + if(result.status === 204){ + this.clearDocumentDirtyFlag(); + } + } + }, + //////////////////////////////////////////////////////////////////// + + clearDocumentDirtyFlag:{ value: function(){ this.activeDocument.dirtyFlag = false; } }, - //////////////////////////////////////////////////////////////////// createNewFile:{ -- cgit v1.2.3