jochen-z
12/29/2017 - 11:34 AM

Collapse or expand all regions

Static ID "MAIN_FRAME" for Static Region

$( "#MAIN_FRAME" ).prepend( '<table width="100%" cellspacing="0" cellpadding="0" border="0" summary=""><tbody><tr><td align="right">
<button aria-label="Expand all" title="Expand all" id="OPENALL" type="button" onclick="void(0);" class="t-Button t-Button--noLabel t-Button--icon  "><span aria-hidden="true" class="t-Icon fa fa-plus-circle"></span></button></td></tr></tbody></table>' );


$( "#OPENALL" ).click(function() {

if ( $( '#OPENALL span.t-Icon.fa.fa-minus-circle' ).hasClass( 'fa-minus-circle' ) ) {			// close everything
            $("button.t-Button.t-Button--icon.t-Button--hideShow").each(function() {
              if ($( this ).attr("aria-expanded") == 'true')
              {
                $( this).click();                    
              }
            });
            $('#OPENALL span.t-Icon.fa.fa-minus-circle' ).removeClass('fa-minus-circle').addClass('fa-plus-circle');
            }
            else {  // open everything
             $("button.t-Button.t-Button--icon.t-Button--hideShow").each(function() {
              if ($( this ).attr("aria-expanded") == 'false')
              {
                $( this).click();                    
              }
            });   
             $( '#OPENALL span.t-Icon.fa.fa-plus-circle' ).removeClass('fa-plus-circle').addClass('fa-minus-circle');
            }

window.scrollTo(0,0);
});
-------