dafiter

help on Sidebar Collapse Button, also has Find/Identify/bookmark

Discussion created by dafiter Champion on Dec 23, 2013
Latest reply on Dec 23, 2013 by dafiter
Howdy all,

I need help getting the sidebar to collapse on my map. I know the rest of the code needs some work. I am having issues adding the sidebar collapse code.
The ideal web map would be one where someone could search for a name, click on results to get zoom to the plot, and a sidebar that would hold the legend.

I have a working version that does not have a sidebar but I believe a legend would be nice for my users.


The real issue is this section


                    
                   var leftDiv = dijit.byId("leftDiv");
                      //connect the click event for the sidebarCollapseDiv
                    dojo.on(sidebarCollapseDiv, 'click', function(evt) {
                        if (leftDiv.domNode.style.display === "none") {
                            dojo.domStyle.set(leftDiv.domNode, 'display', 'block');
                            dojo.domClass.remove(sidebarCollapseDiv, 'open');
                            dojo.domClass.add(sidebarCollapseDiv, 'close');
                        } else {
                            dojo.domStyle.set(leftDiv.domNode, 'display', 'none');
                            dojo.domClass.remove(sidebarCollapseDiv, 'close');
                            dojo.domClass.add(sidebarCollapseDiv, 'open');
                        }
                        leftDiv.resize();
                        //resize the map div
                        dijit.byId('mainDiv').resize();
                        if (map) {
                            map.resize(true);
                            map.reposition();
                        }
                    });
                    dojo.domStyle.set(sidebarCollapseDiv, 'display', 'block');
                    
                    


Below has my full code.

Thank you in advance!

Outcomes