3 # Include this JS and these HTML toggle buttons right on the first position of a .wrapper container
4 # for minimizing / maximizing the surrounding .wrapper container
5 # First Symbols: former ∨ & < but now with icons
6 # It seems advantageous to give an id to the .wrapper-block e.g. #wrapper-1 or #wrapper-basic-data
8 # PENDENT: vielleicht noch generischer programmieren.
11 <div class="toggles" id="toggles">
12 <script type="text/javascript">
13 var toggles_id = "#toggles" ; // surrounding container of the toggle buttons
14 var wrapper = new Object() ;
15 $( window ).on( "load", function() {
16 if( $(toggles_id).parent().attr('class') == "wrapper" ) {
17 wrapper = $(toggles_id).parent() ; // closest surrounding wrapper to toggle, must have the class .wrapper
18 $(wrapper).addClass("toggled") ; // change the wrapper into a inline-block instead of a 100%-width-block
21 var hi = -1; //height of the wrapper
22 $(wrapper).ready(function(){
23 if( hi <= -1 ) hi = $(wrapper).height(); // height of the wrapper
26 $("#toggler-1").click(function(){
27 $(wrapper).animate({height:"30px"},200).addClass("bordered");
29 $("#toggler-2").toggle();
31 // Toggle back to maximum
32 $("#toggler-2").click(function(){
33 $(wrapper).animate({height:hi},200).removeClass("bordered");
35 $("#toggler-1").toggle();
40 <a class="toggle min" id="toggler-1" href="#" style="display:visible;" title="[% 'Minimize Panel' | $T8 %]"></a>
41 <a class="toggle max" id="toggler-2" href="#" style="display:none;" title="[% 'Open Panel' | $T8 %]"></a>
43 </div><!-- /.toggles /#toggles -->