aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorAnanya Sen2012-02-23 17:55:59 -0800
committerAnanya Sen2012-02-23 17:55:59 -0800
commit6e66f411ba02eaaeb33471115345ecf3c7ce4ce9 (patch)
tree527a26ece79b0e55dbb9a310007010631614cc0c /js/document
parentec3d07c2fea4e79c68606234074f43d694982e5b (diff)
downloadninja-6e66f411ba02eaaeb33471115345ecf3c7ce4ce9.tar.gz
refresh draw-utils, snap-manager, view-utils for html document stitching
Signed-off-by: Ananya Sen <Ananya.Sen@motorola.com>
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js18
1 files changed, 7 insertions, 11 deletions
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, {
645 this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; 645 this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing;
646 this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; 646 this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing;
647 647
648 //TODO:selection should be saved as an element state data, to avoid duplicate dom elements store in memory
649 if(typeof this.application.ninja.selectedElements !== 'undefined'){ 648 if(typeof this.application.ninja.selectedElements !== 'undefined'){
650 this.selectionModel = this.application.ninja.selectedElements; 649 this.selectionModel = this.application.ninja.selectedElements;
651 } 650 }
@@ -656,24 +655,21 @@ exports.HTMLDocument = Montage.create(TextDocument, {
656 restoreAppState:{ 655 restoreAppState:{
657 enumerable: false, 656 enumerable: false,
658 value: function () { 657 value: function () {
659 if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){
660 this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll;
661 this.application.ninja.stage._scrollLeft = this.savedLeftScroll;
662 this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll;
663 this.application.ninja.stage._scrollTop = this.savedTopScroll;
664 }
665
666 this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; 658 this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing;
667 this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; 659 this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing;
668 660
669 //TODO:selectionController.initWithDocument should loop over elements in documentRoot to repopulate
670 if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){ 661 if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){
671 this.application.ninja.selectionController.initWithDocument(this.selectionModel); 662 this.application.ninja.selectionController.initWithDocument(this.selectionModel);
672 } 663 }
673
674 664
665 if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){
666 this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll;
667 this.application.ninja.stage._scrollLeft = this.savedLeftScroll;
668 this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll;
669 this.application.ninja.stage._scrollLeft = this.savedTopScroll;
670 }
671 this.application.ninja.stage.handleScroll();
675 } 672 }
676 } 673 }
677
678 //////////////////////////////////////////////////////////////////// 674 ////////////////////////////////////////////////////////////////////
679}); \ No newline at end of file 675}); \ No newline at end of file