aboutsummaryrefslogtreecommitdiff
path: root/js/document
diff options
context:
space:
mode:
Diffstat (limited to 'js/document')
-rwxr-xr-xjs/document/document-html.js2
-rwxr-xr-xjs/document/models/base.js22
2 files changed, 23 insertions, 1 deletions
diff --git a/js/document/document-html.js b/js/document/document-html.js
index 142ffe4a..5079cfca 100755
--- a/js/document/document-html.js
+++ b/js/document/document-html.js
@@ -130,6 +130,8 @@ exports.HtmlDocument = Montage.create(Component, {
130 this._observer = null; 130 this._observer = null;
131 } 131 }
132 }, 132 },
133 ////////////////////////////////////////////////////////////////////
134 //
133 handleViewReady: { 135 handleViewReady: {
134 value: function(mObjects) { 136 value: function(mObjects) {
135 this.model.mObjects = mObjects; 137 this.model.mObjects = mObjects;
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 ////////////////////////////////////////////////////////////////////