Below is the html. Note that I was able to utilize some of the code that is already supplied in an excellent example of a base map template that was created and published by David Spriggs here:https://github.com/DavidSpriggs/ConfigurableViewerJSAPIThe HTML below has the following:1) sidebarCollapseButton div to handle the display style of the left panel2) left panel div with two title panes and divs to hold the legend and editor tools[HTML]<div id="sidebarCollapseButton" class="sidebarCollapseButton close" style="display:none;"></div><div id="leftDiv" data-dojo-type="dijit/layout/ContentPane" data-dojo-props="region:'left'" style="display:block;"> <div id="paneLayers" class="titlePane" data-dojo-type="dijit/TitlePane" data-dojo-props="title: 'Layers', open: true" > <div id="divLegendHolder"></div> </div> <div id="paneEditor" class="titlePane" data-dojo-type="dijit/TitlePane" data-dojo-props="title: 'Editor Tools', open: false" > <div id="editToolbarHolder" ></div> <div id="editTemplateHolder" ></div> </div></div>/* CSS needed for the sidebarCollapse */.sidebarCollapseButton { width: 20px; height: 25px; position: absolute; top: 220px; border-top: 1px solid #B5BCC7; border-right: 1px solid #B5BCC7; border-bottom: 1px solid #B5BCC7; z-index: 40; background-color: white; border-radius: 0 5px 5px 0; background-position: 2px 4px; background-repeat: no-repeat; cursor: pointer;}.sidebarCollapseButton.close { left: 280px; background-image: url("../images/close.png");}.sidebarCollapseButton.open { background-image: url("../images/open.png"); left: 0;}[/HTML]Within the map Init function I call a method similar to the one that David Spriggs has that sets up the sidebarCollapse click event and sets the display style to block. Note that since I have not been able to ugrade my app to AMD I had to get a little "creative". The easiest way I was able to manage the style and get access to the dom objects was by requiring the following dojo libs:"dojo/dom", "dojo/dom-class", "dojo/on", "dojo/dom-style"
require(["dojo/dom", "dojo/dom-class", "dojo/on", "dojo/dom-style"],
function (dom, domClass, dojoOn, domStyle) {
var sidebarCollapseDiv = dom.byId('sidebarCollapseButton');
var leftDiv = dijit.byId("leftDiv");
dojoOn(sidebarCollapseDiv, 'click', function (evt) {
if (leftDiv.domNode.style.display === "none") {
//domStyle.set(sidebarCollapseDiv, 'display', 'block');
domStyle.set(leftDiv.domNode, 'display', 'block');
domClass.remove(sidebarCollapseDiv, 'open');
domClass.add(sidebarCollapseDiv, 'close');
} else {
//domStyle.set(sidebarCollapseDiv, 'display', 'none');
domStyle.set(leftDiv.domNode, 'display', 'none');
domClass.remove(sidebarCollapseDiv, 'close');
domClass.add(sidebarCollapseDiv, 'open');
}
leftDiv.resize();
//domStyle.set(dom.byId('mapDiv'), 'width', '100%');
dijit.byId('mainDiv').resize();
_map.resize(true);
_map.reposition();
//dijit.byId("mapDiv").refresh();
});
domStyle.set(sidebarCollapseDiv, 'display', 'block');
});
The function that is called to connect the onClick event should do something similar to the code below. Again the trick to figure out what lib to use to get access to the dom style and manage the display and add or remove the css class for "open" and "close"
domStyle.set(leftDiv.domNode, 'display', 'block');
domClass.remove(sidebarCollapseDiv, 'open');
domClass.add(sidebarCollapseDiv, 'close');
And would the other code you supplied (var titlePane = dijit.byId("paneEditor");...) go into that same function?
You only need this if you want to also automatically open a title pane by default such as the legend for example otherwise it will open the left panel but keep the state of the title panes as is.