aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-07-16 14:48:47 -0700
committerJose Antonio Marquez2012-07-16 14:48:47 -0700
commitcdaeb7e05e4d59832b9896f6995e0163e3decf50 (patch)
treeb448e82798dd1d90c67776d3ddfb304c0a1e4cf3 /js/document
parent156f15cec3203528a78783d075d4b8f1eb40c06d (diff)
downloadninja-cdaeb7e05e4d59832b9896f6995e0163e3decf50.tar.gz
New: Adding switch view method
Added a method to switch views from code and design. (Code is not currently supported)
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/models/base.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/js/document/models/base.js b/js/document/models/base.js
index c7e2de69..a9bbd6db 100755
--- a/js/document/models/base.js
+++ b/js/document/models/base.js
@@ -91,6 +91,8 @@ exports.BaseDocumentModel = Montage.create(Component, {
91 _selection: { 91 _selection: {
92 value: [] 92 value: []
93 }, 93 },
94 ////////////////////////////////////////////////////////////////////
95 //
94 domContainer: { 96 domContainer: {
95 value: null 97 value: null
96 }, 98 },
@@ -120,7 +122,8 @@ exports.BaseDocumentModel = Montage.create(Component, {
120 libs: { 122 libs: {
121 value: null 123 value: null
122 }, 124 },
123 125 ////////////////////////////////////////////////////////////////////
126 //
124 _mObjects: { 127 _mObjects: {
125 value: [] 128 value: []
126 }, 129 },
@@ -138,6 +141,23 @@ exports.BaseDocumentModel = Montage.create(Component, {
138 switchViewTo: { 141 switchViewTo: {
139 value: function (view) { 142 value: function (view) {
140 // 143 //
144 switch (view) {
145 case 'design':
146 //
147 if (this.views.design) this.views.design.show();
148 if (this.views.code) this.views.code.hide();
149 this.currentView = this.views.design;
150 break;
151 case 'code':
152 //
153 if (this.views.code) this.views.code.show();
154 if (this.views.design) this.views.design.hide();
155 this.currentView = this.views.code;
156 break;
157 default:
158 //Error
159 break;
160 }
141 } 161 }
142 }, 162 },
143 //////////////////////////////////////////////////////////////////// 163 ////////////////////////////////////////////////////////////////////