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 From 9b6da637d9654727426c6d78f17e3804bbd84ce5 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 14:42:43 -0700 Subject: fixing a few document switching issues. Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/document/document-html.js') diff --git a/js/document/document-html.js b/js/document/document-html.js index 983da966..bb391793 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -155,7 +155,7 @@ exports.HtmlDocument = Montage.create(Component, { // Pause the videos this.model.views.design.pauseVideos(); - this.model.isActive = false; +// this.model.isActive = false; } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 2b207ef8b2594927f8cd6cd63a8483d205cb86c4 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 22 May 2012 15:41:51 -0700 Subject: fixing the selection in multiple documents and some code cleanup Signed-off-by: Valerio Virgillito --- js/document/document-html.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/document/document-html.js') diff --git a/js/document/document-html.js b/js/document/document-html.js index d6b4ba95..f92a425c 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js @@ -147,9 +147,10 @@ exports.HtmlDocument = Montage.create(Component, { this.model.userContentTop = this.application.ninja.stage._userContentTop; - // Serialize the selection + // Serialize the selection, the container and grid //TODO: Move this property to the design view class this.model.selection = this.application.ninja.selectedElements.slice(0); + this.model.selectionContainer = this.application.ninja.currentSelectedContainer; this.draw3DGrid = this.application.ninja.appModel.show3dGrid; // Serialize the undo @@ -177,7 +178,7 @@ exports.HtmlDocument = Montage.create(Component, { //TODO: Move this property to the design view class this.application.ninja.selectedElements = this.model.selection.slice(0); - +// this.application.ninja.currentSelectedContainer = this.model.selectionContainer; this.application.ninja.appModel.show3dGrid = this.draw3DGrid; // Serialize the undo -- cgit v1.2.3