aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorJose Antonio Marquez Russo2012-02-24 15:44:57 -0800
committerJose Antonio Marquez Russo2012-02-24 15:44:57 -0800
commit97c0efb645b1e0488112c1b7bfd7fa4864eae3dc (patch)
treeae6c6587af2ab5ec34f86ac05d342ecf8ebfc0c7 /js/document
parentc916a2a5fec0c96bd1c6f56af82543da9b69c33c (diff)
parentb056b4bef5982466d80d72e5cbb31e63087990e1 (diff)
downloadninja-97c0efb645b1e0488112c1b7bfd7fa4864eae3dc.tar.gz
Merge pull request #19 from ananyasen/FileIO
FileIO branch pull request
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/html-document.js53
1 files changed, 52 insertions, 1 deletions
diff --git a/js/document/html-document.js b/js/document/html-document.js
index ca1b0886..1901079d 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -54,6 +54,11 @@ exports.HTMLDocument = Montage.create(TextDocument, {
54 }, 54 },
55 55
56 56
57 //drawUtils state
58 _gridHorizontalSpacing: {value:0},
59 _gridVerticalSpacing: {value:0},
60 //end - drawUtils state
61
57 62
58 // GETTERS / SETTERS 63 // GETTERS / SETTERS
59 64
@@ -72,6 +77,16 @@ exports.HTMLDocument = Montage.create(TextDocument, {
72 set: function(value) { this._savedTopScroll = value} 77 set: function(value) { this._savedTopScroll = value}
73 }, 78 },
74 79
80 gridHorizontalSpacing:{
81 get: function() { return this._gridHorizontalSpacing; },
82 set: function(value) { this._gridHorizontalSpacing = value}
83 },
84
85 gridVerticalSpacing:{
86 get: function() { return this._gridVerticalSpacing; },
87 set: function(value) { this._gridVerticalSpacing = value}
88 },
89
75 selectionExclude: { 90 selectionExclude: {
76 get: function() { return this._selectionExclude; }, 91 get: function() { return this._selectionExclude; },
77 set: function(value) { this._selectionExclude = value; } 92 set: function(value) { this._selectionExclude = value; }
@@ -616,7 +631,43 @@ exports.HTMLDocument = Montage.create(TextDocument, {
616 //Error 631 //Error
617 } 632 }
618 } 633 }
619 } 634 },
620 //////////////////////////////////////////////////////////////////// 635 ////////////////////////////////////////////////////////////////////
636 saveAppState:{
637 enumerable: false,
638 value: function () {
639
640 this.savedLeftScroll = this.application.ninja.stage._iframeContainer.scrollLeft;
641 this.savedTopScroll = this.application.ninja.stage._iframeContainer.scrollTop;
642
643 this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing;
644 this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing;
645
646 if(typeof this.application.ninja.selectedElements !== 'undefined'){
647 this.selectionModel = this.application.ninja.selectedElements;
648 }
649 }
650 },
651
652 ////////////////////////////////////////////////////////////////////
653 restoreAppState:{
654 enumerable: false,
655 value: function () {
656 this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing;
657 this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing;
658
659 if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){
660 this.application.ninja.selectionController.initWithDocument(this.selectionModel);
661 }
662
663 if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){
664 this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll;
665 this.application.ninja.stage._scrollLeft = this.savedLeftScroll;
666 this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll;
667 this.application.ninja.stage._scrollLeft = this.savedTopScroll;
668 }
669 this.application.ninja.stage.handleScroll();
670 }
671 }
621 //////////////////////////////////////////////////////////////////// 672 ////////////////////////////////////////////////////////////////////
622}); \ No newline at end of file 673}); \ No newline at end of file