1 | <div class="wrap"> |
---|
2 | Bottom Pane Content: |
---|
3 | <button dojoType="dijit.form.Button"> |
---|
4 | Setup Toggler |
---|
5 | <script type="dojo/method" data-dojo-event="onClick"> |
---|
6 | // only do this once: |
---|
7 | this.setAttribute('disabled',true); |
---|
8 | var pane = dijit.getEnclosingWidget(this.domNode.parentNode); |
---|
9 | |
---|
10 | dijit.registry |
---|
11 | .filter(function(n){ |
---|
12 | // there is probably an easier way to get all the Splitters |
---|
13 | return n.declaredClass == "dijit.layout._Splitter"; |
---|
14 | }) |
---|
15 | .forEach(function(n){ |
---|
16 | // add some stuff to this instance: |
---|
17 | dojo.mixin(n,{ |
---|
18 | // toggle additions: |
---|
19 | _hackSize:null, |
---|
20 | _hackShowing:true, |
---|
21 | /*_setHack:function(e){ |
---|
22 | this._hackShowing = true; |
---|
23 | },*/ |
---|
24 | _tgl: function(e){ |
---|
25 | if(this._hackShowing){ |
---|
26 | this._hackSize = dojo.marginBox(this.child.domNode); |
---|
27 | this.child.domNode.style.height = "1px"; |
---|
28 | }else{ |
---|
29 | this.child.domNode.style.height = this._hackSize.h + "px"; |
---|
30 | } |
---|
31 | // toggle state, and call layout() on parent |
---|
32 | this._hackShowing = !this._hackShowing; |
---|
33 | dijit.getEnclosingWidget(this.domNode.parentNode).layout(); |
---|
34 | } |
---|
35 | }); |
---|
36 | // using it's internal connect method, setup the toggler |
---|
37 | n.connect(n.domNode,"ondblclick","_tgl"); |
---|
38 | //n.connect(n,"_cleanupHandlers","_setHack"); |
---|
39 | }); |
---|
40 | </script> |
---|
41 | </button> |
---|
42 | |
---|
43 | <button dojoType="dijit.form.Button"> |
---|
44 | Minimize |
---|
45 | <script type="dojo/method" data-dojo-event="onClick"> |
---|
46 | // simplified version of above: |
---|
47 | var pane = dijit.getEnclosingWidget(this.domNode.parentNode); |
---|
48 | pane.domNode.style.height = "1px"; |
---|
49 | dijit.byId("bc").layout(); |
---|
50 | </script> |
---|
51 | </button> |
---|
52 | |
---|
53 | </div> |
---|