From cdaeb7e05e4d59832b9896f6995e0163e3decf50 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 16 Jul 2012 14:48:47 -0700 Subject: New: Adding switch view method Added a method to switch views from code and design. (Code is not currently supported) --- js/document/models/base.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'js/document') 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, { _selection: { value: [] }, + //////////////////////////////////////////////////////////////////// + // domContainer: { value: null }, @@ -120,7 +122,8 @@ exports.BaseDocumentModel = Montage.create(Component, { libs: { value: null }, - + //////////////////////////////////////////////////////////////////// + // _mObjects: { value: [] }, @@ -138,6 +141,23 @@ exports.BaseDocumentModel = Montage.create(Component, { switchViewTo: { value: function (view) { // + switch (view) { + case 'design': + // + if (this.views.design) this.views.design.show(); + if (this.views.code) this.views.code.hide(); + this.currentView = this.views.design; + break; + case 'code': + // + if (this.views.code) this.views.code.show(); + if (this.views.design) this.views.design.hide(); + this.currentView = this.views.code; + break; + default: + //Error + break; + } } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3