From 48beced355a5d4ee959ed41e104b0a343411658c Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 18 May 2012 16:33:10 -0700 Subject: Clean up and adding TODOs --- js/document/document-html.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'js/document/document-html.js') diff --git a/js/document/document-html.js b/js/document/document-html.js index 983da966..ae5b73b6 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -125,9 +125,10 @@ exports.HtmlDocument = Montage.create(Component, { // closeDocument: { value: function (context, callback) { + //Closing document and getting outcome var closed = this.model.close(null); - - callback.call(context, this); + //Making callback if specified + if (callback) callback.call(context, this); } }, //////////////////////////////////////////////////////////////////// @@ -139,6 +140,7 @@ exports.HtmlDocument = Montage.create(Component, { //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; // Serialize the current scroll position + //TODO: Move these properties to the design view class this.model.scrollLeft = this.application.ninja.stage._scrollLeft; this.model.scrollTop = this.application.ninja.stage._scrollTop; this.model.userContentLeft = this.application.ninja.stage._userContentLeft; @@ -146,6 +148,7 @@ exports.HtmlDocument = Montage.create(Component, { // Serialize the selection + //TODO: Move this property to the design view class this.model.selection = this.application.ninja.selectedElements.slice(0); this.draw3DGrid = this.application.ninja.appModel.show3dGrid; @@ -153,8 +156,10 @@ exports.HtmlDocument = Montage.create(Component, { // TODO: Save the montage undo queue // Pause the videos + //TODO: Move these to be handled on the show/hide methods in the view this.model.views.design.pauseVideos(); - + + //TODO: Move this to the document controller this.model.isActive = false; } }, @@ -167,18 +172,21 @@ exports.HtmlDocument = Montage.create(Component, { //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; // Deserialize the current scroll position + //TODO: Move these properties to the design view class this.application.ninja.stage._scrollLeft = this.model.scrollLeft; this.application.ninja.stage._scrollTop = this.model.scrollTop; this.application.ninja.stage._userContentLeft = this.model.userContentLeft; this.application.ninja.stage._userContentTop = this.model.userContentTop; - + + //TODO: Move this property to the design view class this.application.ninja.selectedElements = this.model.selection.slice(0); this.application.ninja.appModel.show3dGrid = this.draw3DGrid; // Serialize the undo // TODO: Save the montage undo queue - + + //TODO: Move this to the document controller this.model.isActive = true; } } -- cgit v1.2.3