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 6394e3ce..8798b407 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; } |
@@ -593,7 +608,43 @@ exports.HTMLDocument = Montage.create(TextDocument, { | |||
593 | //Error | 608 | //Error |
594 | } | 609 | } |
595 | } | 610 | } |
596 | } | 611 | }, |
597 | //////////////////////////////////////////////////////////////////// | 612 | //////////////////////////////////////////////////////////////////// |
613 | saveAppState:{ | ||
614 | enumerable: false, | ||
615 | value: function () { | ||
616 | |||
617 | this.savedLeftScroll = this.application.ninja.stage._iframeContainer.scrollLeft; | ||
618 | this.savedTopScroll = this.application.ninja.stage._iframeContainer.scrollTop; | ||
619 | |||
620 | this.gridHorizontalSpacing = this.application.ninja.stage.drawUtils.gridHorizontalSpacing; | ||
621 | this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; | ||
622 | |||
623 | if(typeof this.application.ninja.selectedElements !== 'undefined'){ | ||
624 | this.selectionModel = this.application.ninja.selectedElements; | ||
625 | } | ||
626 | } | ||
627 | }, | ||
628 | |||
629 | //////////////////////////////////////////////////////////////////// | ||
630 | restoreAppState:{ | ||
631 | enumerable: false, | ||
632 | value: function () { | ||
633 | this.application.ninja.stage.drawUtils.gridHorizontalSpacing = this.gridHorizontalSpacing; | ||
634 | this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; | ||
635 | |||
636 | if((typeof this.selectionModel !== 'undefined') && (this.selectionModel !== null) && (this.selectionModel.length > 0)){ | ||
637 | this.application.ninja.selectionController.initWithDocument(this.selectionModel); | ||
638 | } | ||
639 | |||
640 | if((this.savedLeftScroll!== null) && (this.savedTopScroll !== null)){ | ||
641 | this.application.ninja.stage._iframeContainer.scrollLeft = this.savedLeftScroll; | ||
642 | this.application.ninja.stage._scrollLeft = this.savedLeftScroll; | ||
643 | this.application.ninja.stage._iframeContainer.scrollTop = this.savedTopScroll; | ||
644 | this.application.ninja.stage._scrollLeft = this.savedTopScroll; | ||
645 | } | ||
646 | this.application.ninja.stage.handleScroll(); | ||
647 | } | ||
648 | } | ||
598 | //////////////////////////////////////////////////////////////////// | 649 | //////////////////////////////////////////////////////////////////// |
599 | }); \ No newline at end of file | 650 | }); \ No newline at end of file |