From 5946ec8651547f846520add097850470a09df635 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Russo Date: Mon, 23 Jul 2012 19:07:11 -0700 Subject: In Progress: Cleaning up merge Cleaned up new updates. Still pending is adding functionality to parse the document when toggling views and fix Timeline errors. Code view also has some rending issues that will be fixed, this is just a clean up. --- .../layout/document-bar.reel/document-bar.js | 63 +++++++++------------- 1 file changed, 26 insertions(+), 37 deletions(-) (limited to 'js/components/layout/document-bar.reel') diff --git a/js/components/layout/document-bar.reel/document-bar.js b/js/components/layout/document-bar.reel/document-bar.js index 803d2c3a..f5e61a18 100755 --- a/js/components/layout/document-bar.reel/document-bar.js +++ b/js/components/layout/document-bar.reel/document-bar.js @@ -73,12 +73,12 @@ exports.DocumentBar = Montage.create(Component, { _codeEditorWrapper:{ value: null }, - + //////////////////////////////////////////////////////////////////// + // codeEditorWrapper:{ - get : function() { - return this._codeEditorWrapper; - }, - set : function(value) { + get: function() {return this._codeEditorWrapper;}, + set: function(value) { + // if(this._codeEditorWrapper !== value){ this._codeEditorWrapper = value; } @@ -89,9 +89,13 @@ exports.DocumentBar = Montage.create(Component, { btnCode: { value: null }, + //////////////////////////////////////////////////////////////////// + // btnDesign: { value: null }, + //////////////////////////////////////////////////////////////////// + // btnPreview: { value: null }, @@ -209,52 +213,37 @@ exports.DocumentBar = Montage.create(Component, { }, //////////////////////////////////////////////////////////////////// // - renderDesignView: { + showViewDesign: { value: function () { - //Reloading in design view (with updates from other view) - this.reloadView('design', this.fileTemplate); + // + this.showView('design', this.renderDesignView, this.btnDesign, this.btnCode); } }, //////////////////////////////////////////////////////////////////// // - renderCodeView: { + showViewCode: { value: function () { - //Reloading in code view (with updates from other view) - this.reloadView('code', this.fileTemplate); + // + this.showView('code', this.renderCodeView, this.btnCode, this.btnDesign); } }, //////////////////////////////////////////////////////////////////// // - showViewDesign: { - value: function () { - // - if (this._currentDocument.model.currentView !== 'design') { + showView: { + value: function (view, render, aBtn, iBtn) { + //TODO: Remove reference to string view + if (this._currentDocument.model.currentView !== view) { // - this._currentDocument.model.switchViewTo('design'); - this.btnCode.setAttribute('class', 'inactive'); - this.btnDesign.removeAttribute('class'); - //this._currentDocument.model.file.content.body = '
hello
hello
'; - var render = this.renderDesignView.bind(this._currentDocument); - render(); + this._currentDocument.model.switchViewTo(view); + iBtn.setAttribute('class', 'inactive'); + aBtn.removeAttribute('class'); + //TODO: Add document parsing to reload view + this._currentDocument.reloadView(view, this.fileTemplate); } - } + } }, //////////////////////////////////////////////////////////////////// - //TODO: Implement code with that updates the file template through the ninja document parser - showViewCode: { - value: function () { - // - if (this._currentDocument.model.currentView !== 'code') { - // - this._currentDocument.model.switchViewTo('code'); - this.btnDesign.setAttribute('class', 'inactive'); - this.btnCode.removeAttribute('class'); - var render = this.renderCodeView.bind(this._currentDocument); - render(); - } - } - }, - + // handleClick: { value: function(evt) { NJevent("executePreview"); -- cgit v1.2.3