diff options
author | Jose Antonio Marquez | 2012-05-18 16:33:10 -0700 |
---|---|---|
committer | Jose Antonio Marquez | 2012-05-18 16:33:10 -0700 |
commit | 48beced355a5d4ee959ed41e104b0a343411658c (patch) | |
tree | 6373a3098e82dbc17c470b3e68bc024d75578092 | |
parent | d878aa470074d5698a316512b513949fa22073f2 (diff) | |
download | ninja-48beced355a5d4ee959ed41e104b0a343411658c.tar.gz |
Clean up and adding TODOs
-rwxr-xr-x | js/document/document-html.js | 18 | ||||
-rwxr-xr-x | js/document/models/base.js | 2 |
2 files changed, 14 insertions, 6 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js index 983da966..ae5b73b6 100755 --- a/js/document/document-html.js +++ b/js/document/document-html.js | |||
@@ -125,9 +125,10 @@ exports.HtmlDocument = Montage.create(Component, { | |||
125 | // | 125 | // |
126 | closeDocument: { | 126 | closeDocument: { |
127 | value: function (context, callback) { | 127 | value: function (context, callback) { |
128 | //Closing document and getting outcome | ||
128 | var closed = this.model.close(null); | 129 | var closed = this.model.close(null); |
129 | 130 | //Making callback if specified | |
130 | callback.call(context, this); | 131 | if (callback) callback.call(context, this); |
131 | } | 132 | } |
132 | }, | 133 | }, |
133 | //////////////////////////////////////////////////////////////////// | 134 | //////////////////////////////////////////////////////////////////// |
@@ -139,6 +140,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
139 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; | 140 | //this.gridVerticalSpacing = this.application.ninja.stage.drawUtils.gridVerticalSpacing; |
140 | 141 | ||
141 | // Serialize the current scroll position | 142 | // Serialize the current scroll position |
143 | //TODO: Move these properties to the design view class | ||
142 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; | 144 | this.model.scrollLeft = this.application.ninja.stage._scrollLeft; |
143 | this.model.scrollTop = this.application.ninja.stage._scrollTop; | 145 | this.model.scrollTop = this.application.ninja.stage._scrollTop; |
144 | this.model.userContentLeft = this.application.ninja.stage._userContentLeft; | 146 | this.model.userContentLeft = this.application.ninja.stage._userContentLeft; |
@@ -146,6 +148,7 @@ exports.HtmlDocument = Montage.create(Component, { | |||
146 | 148 | ||
147 | 149 | ||
148 | // Serialize the selection | 150 | // Serialize the selection |
151 | //TODO: Move this property to the design view class | ||
149 | this.model.selection = this.application.ninja.selectedElements.slice(0); | 152 | this.model.selection = this.application.ninja.selectedElements.slice(0); |
150 | this.draw3DGrid = this.application.ninja.appModel.show3dGrid; | 153 | this.draw3DGrid = this.application.ninja.appModel.show3dGrid; |
151 | 154 | ||
@@ -153,8 +156,10 @@ exports.HtmlDocument = Montage.create(Component, { | |||
153 | // TODO: Save the montage undo queue | 156 | // TODO: Save the montage undo queue |
154 | 157 | ||
155 | // Pause the videos | 158 | // Pause the videos |
159 | //TODO: Move these to be handled on the show/hide methods in the view | ||
156 | this.model.views.design.pauseVideos(); | 160 | this.model.views.design.pauseVideos(); |
157 | 161 | ||
162 | //TODO: Move this to the document controller | ||
158 | this.model.isActive = false; | 163 | this.model.isActive = false; |
159 | } | 164 | } |
160 | }, | 165 | }, |
@@ -167,18 +172,21 @@ exports.HtmlDocument = Montage.create(Component, { | |||
167 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; | 172 | //this.application.ninja.stage.drawUtils.gridVerticalSpacing = this.gridVerticalSpacing; |
168 | 173 | ||
169 | // Deserialize the current scroll position | 174 | // Deserialize the current scroll position |
175 | //TODO: Move these properties to the design view class | ||
170 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; | 176 | this.application.ninja.stage._scrollLeft = this.model.scrollLeft; |
171 | this.application.ninja.stage._scrollTop = this.model.scrollTop; | 177 | this.application.ninja.stage._scrollTop = this.model.scrollTop; |
172 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; | 178 | this.application.ninja.stage._userContentLeft = this.model.userContentLeft; |
173 | this.application.ninja.stage._userContentTop = this.model.userContentTop; | 179 | this.application.ninja.stage._userContentTop = this.model.userContentTop; |
174 | 180 | ||
181 | //TODO: Move this property to the design view class | ||
175 | this.application.ninja.selectedElements = this.model.selection.slice(0); | 182 | this.application.ninja.selectedElements = this.model.selection.slice(0); |
176 | 183 | ||
177 | this.application.ninja.appModel.show3dGrid = this.draw3DGrid; | 184 | this.application.ninja.appModel.show3dGrid = this.draw3DGrid; |
178 | 185 | ||
179 | // Serialize the undo | 186 | // Serialize the undo |
180 | // TODO: Save the montage undo queue | 187 | // TODO: Save the montage undo queue |
181 | 188 | ||
189 | //TODO: Move this to the document controller | ||
182 | this.model.isActive = true; | 190 | this.model.isActive = true; |
183 | } | 191 | } |
184 | } | 192 | } |
diff --git a/js/document/models/base.js b/js/document/models/base.js index c99e36c7..6d9d2e89 100755 --- a/js/document/models/base.js +++ b/js/document/models/base.js | |||
@@ -100,7 +100,7 @@ exports.BaseDocumentModel = Montage.create(Component, { | |||
100 | } | 100 | } |
101 | break; | 101 | break; |
102 | default: | 102 | default: |
103 | if (this.template.type === 'banner' || this.template.type === 'animation') { | 103 | if (this.template && (this.template.type === 'banner' || this.template.type === 'animation')) { |
104 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); | 104 | window.open('/js/document/templates/preview/banner.html?width='+this.template.size.width+'&height='+this.template.size.height+'&url='+this.url); |
105 | } else { | 105 | } else { |
106 | window.open(this.url); | 106 | window.open(this.url); |