From 272c5f74f4ce76fec9cbe360817bf23639307d3a Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Sun, 5 Feb 2012 19:20:37 -0800 Subject: changes to show document dirty indicator on editing code view, and to remove dirty indicator on save. Signed-off-by: Ananya Sen --- js/io/document/html-document.js | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'js/io/document/html-document.js') diff --git a/js/io/document/html-document.js b/js/io/document/html-document.js index da1bbe4a..8e1eb614 100755 --- a/js/io/document/html-document.js +++ b/js/io/document/html-document.js @@ -449,17 +449,22 @@ var HTMLDocument = exports.HTMLDocument = Montage.create(baseDocumentModule.Base */ save:{ value:function(removeCodeMirrorDivFlag){ - if(this.currentView === "design"){ - //generate html and save - }else if((this.currentView === "code") && (this.codeViewDocument !== null)){ - if(removeCodeMirrorDivFlag === true){ - this.codeViewDocument.save(true); - }else{ - this.codeViewDocument.save(); + try{ + if(this.currentView === "design"){ + //generate html and save + }else if((this.currentView === "code") && (this.codeViewDocument !== null)){ + if(removeCodeMirrorDivFlag === true){ + this.codeViewDocument.save(true); + }else{ + this.codeViewDocument.save(); + } + //persist to filesystem } - //persist to filesystem + this.dirtyFlag=false; + }catch(e){ + console.log("Error while saving "+this.uri); + console.log(e.stack); } - } } }); \ No newline at end of file -- cgit v1.2.3