From 2cc8e58f6bb9f64a7473e62aecd013fa55167231 Mon Sep 17 00:00:00 2001 From: Ananya Sen Date: Mon, 21 May 2012 16:42:26 -0700 Subject: - added opening multiple code and design view documents - switching between multiple code and design view documents - Note: closing of documents, when multiple documents are open, is not yet implemented Signed-off-by: Ananya Sen --- js/document/models/text.js | 4 ++-- js/document/views/code.js | 54 ++++++++++++---------------------------------- 2 files changed, 16 insertions(+), 42 deletions(-) (limited to 'js/document') diff --git a/js/document/models/text.js b/js/document/models/text.js index fe02953c..d1252b7d 100755 --- a/js/document/models/text.js +++ b/js/document/models/text.js @@ -60,8 +60,8 @@ exports.TextDocumentModel = Montage.create(BaseDocumentModel, { } // this.parentContainer.removeChild(this.views.code.textViewContainer); - this.views.code.restoreAllPanels(); - this.views.code.showCodeViewBar(false); + this.application.ninja.stage.showCodeViewBar(false); + this.application.ninja.stage.restoreAllPanels(); this.views.code = null; // diff --git a/js/document/views/code.js b/js/document/views/code.js index 711479a8..66d1c702 100755 --- a/js/document/views/code.js +++ b/js/document/views/code.js @@ -140,56 +140,30 @@ var CodeDocumentView = exports.CodeDocumentView = Montage.create(BaseDocumentVie }, //////////////////////////////////////////////////////////////////// // - - showRulers:{ - value:function(){ - this.application.ninja.rulerTop.style.display = "block"; - this.application.ninja.rulerLeft.style.display = "block"; - } - }, - hideRulers:{ - value:function(){ - this.application.ninja.rulerTop.style.display = "none"; - this.application.ninja.rulerLeft.style.display = "none"; - } - }, - showCodeViewBar:{ - value:function(isCodeView){ - if(isCodeView === true) { - this.application.ninja.editorViewOptions.element.style.display = "block"; - this.application.ninja.documentBar.element.style.display = "none"; - } else { - this.application.ninja.documentBar.element.style.display = "block"; - this.application.ninja.editorViewOptions.element.style.display = "none"; - } - } - }, - - collapseAllPanels:{ - value:function(){ - this.application.ninja.panelSplitter.collapse(); - this.application.ninja.timelineSplitter.collapse(); - this.application.ninja.toolsSplitter.collapse(); - this.application.ninja.optionsSplitter.collapse(); + show: { + value: function (callback) { + this.textViewContainer.style.display = "block"; + // + if (callback) callback(); } }, - restoreAllPanels:{ - value:function(){ - this.application.ninja.panelSplitter.restore(); - this.application.ninja.timelineSplitter.restore(); - this.application.ninja.toolsSplitter.restore(); - this.application.ninja.optionsSplitter.restore(); + //////////////////////////////////////////////////////////////////// + // + hide: { + value: function (callback) { + this.textViewContainer.style.display = "none"; + // + if (callback) callback(); } }, - + //////////////////////////////////////////////////////////////////// + // applyTheme:{ value:function(themeClass){ //Todo: change for bucket structure of documents this.textViewContainer.className = "codeViewContainer "+themeClass; } } - - //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// }); -- cgit v1.2.3