aboutsummaryrefslogtreecommitdiff
path: root/js/document/views
diff options
context:
space:
mode:
authorNivesh Rajbhandari2012-05-23 16:09:22 -0700
committerNivesh Rajbhandari2012-05-23 16:09:22 -0700
commitf97590388467b5a3316f6f155162fc293915fddc (patch)
treea2888e65b53704caeb9f4f84d5a85dbdb19e4ff6 /js/document/views
parentf1dbf7c58e91a27c80f3a607e87ad122d803c500 (diff)
downloadninja-f97590388467b5a3316f6f155162fc293915fddc.tar.gz
Fixed scrolling and centering stage code. Also, moved liveNodeList into the design view and added an option to exclude styles and text nodes when retrieving the live nodes.
Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com>
Diffstat (limited to 'js/document/views')
-rwxr-xr-xjs/document/views/design.js42
1 files changed, 40 insertions, 2 deletions
diff --git a/js/document/views/design.js b/js/document/views/design.js
index b3887fdf..427ef706 100755
--- a/js/document/views/design.js
+++ b/js/document/views/design.js
@@ -67,8 +67,44 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
67 propertiesPanel: { 67 propertiesPanel: {
68 value: null 68 value: null
69 }, 69 },
70
70 //////////////////////////////////////////////////////////////////// 71 ////////////////////////////////////////////////////////////////////
71 // 72 //
73 _liveNodeList: {
74 value: null
75 },
76
77 getLiveNodeList: {
78 value: function(useFilter) {
79 if(useFilter) {
80 var filteredNodes = [],
81 childNodes = Array.prototype.slice.call(this._liveNodeList, 0);
82
83 childNodes.forEach(function(item) {
84 if( (item.nodeType === 1) && (item.nodeName !== "STYLE") && (item.nodeName !== "SCRIPT")) {
85 filteredNodes.push(item);
86 }
87 });
88 return filteredNodes;
89 } else {
90 return this._liveNodeList;
91 }
92 }
93 },
94 ////////////////////////////////////////////////////////////////////
95 //
96
97 initialPaddingLeft: {
98 value: 0
99 },
100
101 initialPaddingTop: {
102 value: 0
103 },
104 ////////////////////////////////////////////////////////////////////
105 //
106
107 //
72 initialize: { 108 initialize: {
73 value: function (parent) { 109 value: function (parent) {
74 //Creating iFrame for view 110 //Creating iFrame for view
@@ -190,8 +226,10 @@ exports.DesignDocumentView = Montage.create(BaseDocumentView, {
190 //Calling standard method to finish opening document 226 //Calling standard method to finish opening document
191 this.bodyContentLoaded(null); 227 this.bodyContentLoaded(null);
192 //TODO: Move this to be set via the controller 228 //TODO: Move this to be set via the controller
193 this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2); 229// this.application.ninja.stage.documentOffsetLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2);
194 this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2); 230// this.application.ninja.stage.documentOffsetTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2);
231// this.initialPaddingLeft = parseInt((this.document.body.scrollWidth - this._template.size.width)/2);
232// this.initialPaddingTop = parseInt((this.document.body.scrollHeight - this._template.size.height)/2);
195 } 233 }
196 }, 234 },
197 //////////////////////////////////////////////////////////////////// 235 ////////////////////////////////////////////////////////////////////