From 6e66f411ba02eaaeb33471115345ecf3c7ce4ce9 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Thu, 23 Feb 2012 17:55:59 -0800 Subject: refresh draw-utils, snap-manager, view-utils for html document stitching Signed-off-by: Ananya Sen --- js/document/html-document.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'js/document') diff --git a/js/document/html-document.js b/js/document/html-document.js index d38709e3..c5293386 100755 --- a/js/document/html-document.js +++ b/js/document/html-document.js @@ -645,7 +645,6 @@ exports.HTMLDocument = Montage.create(TextDocument, { this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; - //TODO:selection should be saved as an element state data, to avoid duplicate dom elements store in memory if(typeof this.application.ninja.selectedElements !== 'undefined'){ this.selectionModel = this.application.ninja.selectedElements; } @@ -656,24 +655,21 @@ exports.HTMLDocument = Montage.create(TextDocument, { restoreAppState:{ enumerable: false, value: function () { - if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){ - this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll; - this.application.ninja.stage._scrollLeft = this.savedLeftScroll; - this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll; - this.application.ninja.stage._scrollTop = this.savedTopScroll; - } - this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; - //TODO:selectionController.initWithDocument should loop over elements in documentRoot to repopulate if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){ this.application.ninja.selectionController.initWithDocument(this.selectionModel); } - + if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){ + this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll; + this.application.ninja.stage._scrollLeft = this.savedLeftScroll; + this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll; + this.application.ninja.stage._scrollLeft = this.savedTopScroll; + } + this.application.ninja.stage.handleScroll(); } } - //////////////////////////////////////////////////////////////////// }); \ No newline at end of file -- cgit v1.2.3