5 /page/optional_show.mas - a doodad to show an optional section
9 C<<& /page/optional_show.mas, title=> $title, content=>$content, default_show=>1 &>>
11 IMPORTANT: This mason component depends on jQuery. The enclosing component is responsible for importing jqueryui.
18 $id => 'optional_show_'.++$uniq_id_count
27 <!-- & /util/import_javascript.mas, classes => 'jqueryui' & -->
28 <div id="<% $id %>" class="optional_show <% $class %>">
29 <h3 class="<% $default_show ? 'active' : '' %>"><span class="icon"> </span><span class="title"><% $title %></span></h3>
31 <% $m->content || $content %>
34 <script type="text/javascript">
36 $("#<% $id %> h3").click(function() {
37 $(this).next().toggle();
38 $(this).toggleClass('active');
40 })<% $default_show ? '' : '.next().hide();' %>