diff options
Diffstat (limited to 'js/document')
-rwxr-xr-x | js/document/html-document.js | 53 |
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 |