summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSilenio Quarti <Silenio_Quarti@ca.ibm.com>2015-04-07 15:31:46 -0400
committerSilenio Quarti <Silenio_Quarti@ca.ibm.com>2015-04-07 15:31:46 -0400
commit7cd6958fa8ef3a3e4a79cfe909f80fa7dc044000 (patch)
tree0e5ed47708112a473b2d98c1b6d567b9b863c2d6
parentc6f8b5c92b79f8a54cdd64581057ec7ed656d357 (diff)
downloadorg.eclipse.orion.client-origin/emoffatt/SplitEditors.zip
org.eclipse.orion.client-origin/emoffatt/SplitEditors.tar.gz
org.eclipse.orion.client-origin/emoffatt/SplitEditors.tar.bz2
dark launch split editorsorigin/emoffatt/SplitEditors
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/edit/setup.js18
1 files changed, 15 insertions, 3 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/edit/setup.js b/bundles/org.eclipse.orion.client.ui/web/edit/setup.js
index 9390bce..2bbda96 100644
--- a/bundles/org.eclipse.orion.client.ui/web/edit/setup.js
+++ b/bundles/org.eclipse.orion.client.ui/web/edit/setup.js
@@ -58,6 +58,8 @@ define([
var exports = {};
+var enableSplitEditor = false;
+
var uriTemplate = new URITemplate("#{,resource,params*}"); //$NON-NLS-0$
function MenuBar(options) {
@@ -243,6 +245,11 @@ function EditorViewer(options) {
contentNode.className = "editorViewerContent"; //$NON-NLS-0$
domNode.appendChild(contentNode);
+ if (!enableSplitEditor) {
+ headerNode.style.display = "none"; //$NON-NLS-0$
+ contentNode.style.top = "0"; //$NON-NLS-0$
+ }
+
domNode.addEventListener("mousedown", function() { //$NON-NLS-0$
this.activateContext.setActiveEditorViewer(this);
}.bind(this), true);
@@ -724,7 +731,7 @@ objects.mixin(EditorSetup.prototype, {
// TODO the command exclusions should be an API and specified by individual pages (page links)?
mGlobalCommands.setPageCommandExclusions(["orion.editFromMetadata"]); //$NON-NLS-0$
mGlobalCommands.setPageTarget({
- viewer: editorViewer,
+ viewer: enableSplitEditor ? editorViewer : null,
task: messages["Editor"],
name: targetName,
target: target,
@@ -867,13 +874,18 @@ objects.mixin(EditorSetup.prototype, {
});
exports.setUpEditor = function(serviceRegistry, pluginRegistry, preferences, readonly) {
+ enableSplitEditor = localStorage.enableSplitEditor;
+
var setup = new EditorSetup(serviceRegistry, pluginRegistry, preferences, readonly);
Deferred.when(setup.createBanner(), function() {
- setup.createSplitMenu();
setup.createMenuBar().then(function() {
setup.createSideBar();
setup.editorViewers.push(setup.createEditorViewer());
- setup.setSplitterMode(setup.splitMenu.MODE_SINGLE);
+ setup.setActiveEditorViewer(setup.editorViewers[0]);
+ if (enableSplitEditor) {
+ setup.createSplitMenu();
+ setup.setSplitterMode(setup.splitMenu.MODE_SINGLE);
+ }
setup.load();
});
});