Skip to content

Commit

Permalink
Add collapsable header to render group
Browse files Browse the repository at this point in the history
  • Loading branch information
cluke009 committed Oct 28, 2014
1 parent 67f9d26 commit 47593a8
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions CMB2.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,19 +233,11 @@ public function render_group( $args ) {

public function render_group_row( $field_group, $remove_disabled ) {

echo '
<div class="cmb-row cmb-repeatable-grouping" data-iterator="'. $field_group->count() .'">
<div class="cmb-td">
<div class="cmb-nested cmb-field-list" style="width: 100%;">';
echo '<div class="postbox"><div class="handlediv" title="Click to toggle"><br></div>';
if ( $field_group->options( 'group_title' ) ) {
echo '
<div class="cmb-row cmb-group-title">
<div class="cmb-th">
', sprintf( '<h4>%1$s</h4>', $field_group->replace_hash( $field_group->options( 'group_title' ) ) ), '
</div>
</div>
';
echo sprintf( '<h3 class="hndle"><span>%1$s</span></h3>', $field_group->replace_hash( $field_group->options( 'group_title' ) ) );
}
echo '<div class="cmb-row inside cmb-repeatable-grouping" data-iterator="'. $field_group->count() .'">';
// Loop and render repeatable group fields
foreach ( array_values( $field_group->args( 'fields' ) ) as $field_args ) {
if ( 'hidden' == $field_args['type'] ) {
Expand Down Expand Up @@ -274,8 +266,6 @@ public function render_group_row( $field_group, $remove_disabled ) {
</div>
</div>
</div>
</div>
</div>
';

$field_group->args['count']++;
Expand Down

0 comments on commit 47593a8

Please sign in to comment.