Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions css/fieldmanager-group-tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@
border-top: none;
}

.fm-wrapper .wp-tabs-panel > .fm-wrapper .fm-group-inner {
border-top: solid 1px #dfdfdf;
}

/* Vertical Tabs */
.fm-tabbed-vertical {
margin: -6px -12px -12px;
Expand Down
47 changes: 43 additions & 4 deletions css/fieldmanager.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,24 @@

/* Groups */
.fm-group {
border: solid 1px #dfdfdf;
margin-bottom: 5px;
background-color: #fff;
}

.fm-group-inner,
.fm-group-label-wrapper {
border: solid 1px #dfdfdf;
-webkit-box-shadow: 0 1px 1px rgba(0,0,0,.04);
box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.fm-group-inner {
padding: 10px;
border-top: 1px solid #dfdfdf;
border-top: none;
}

.fm-group h4, .fm-group div.fm-group-label-wrapper {
.fm-group h4,
.fm-group div.fm-group-label-wrapper {
cursor: default;
font-size: 13px;
padding: 5px 5px 7px;
Expand All @@ -53,6 +58,40 @@
color: #222;
}

.fm-group-label-wrapper.fmjs-drag-header:hover,
.fm-group-label-wrapper.fmjs-collapsible-handle:hover {
border: 1px solid #999;
}

.fm-group-label-wrapper.fmjs-collapsible-handle .fmjs-remove {
display:none;
}

.fm-group-label-wrapper.fmjs-collapsible-handle:hover .fmjs-remove {
display: block;
}

.fm-group-label-wrapper.fmjs-collapsible-handle:hover .toggle-indicator {
color: #777;
}

.fm-group .toggle-indicator {
color: #a0a5aa;
margin-left: 5px;
}

.fm-group .toggle-indicator:before {
vertical-align: middle;
}

.fm-item .fmjs-collapsible-handle.closed .toggle-indicator:before {
content: "\f140";
}

.fmjs-collapsible-handle .toggle-indicator {
float: right;
}

div.fm-group-label-wrapper {
overflow: auto;
}
Expand Down Expand Up @@ -330,4 +369,4 @@ a.fm-delete:hover {
.form-field .fm-option label,
.form-field .fm-checkbox label {
display: inline;
}
}
6 changes: 6 additions & 0 deletions js/fieldmanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ $( document ).ready( function () {
$( this ).parents( '.fm-group' ).first().children( '.fm-group-inner' ).slideToggle( 'fast' );
fm_renumber( $( this ).parents( '.fm-wrapper' ).first() );
$( this ).parents( '.fm-group' ).first().trigger( 'fm_collapsible_toggle' );
$( this ).toggleClass( 'closed' );
if ( $( this ).hasClass( 'closed' ) ) {
$( this ).attr( 'aria-expanded', 'false' );
} else {
$( this ).attr( 'aria-expanded', 'true' );
}
} );

$( '.fm-collapsed > .fm-group:not(.fmjs-proto) > .fm-group-inner' ).hide();
Expand Down
2 changes: 1 addition & 1 deletion php/class-fieldmanager-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ public function get_remove_handle() {
* @return string
*/
public function get_collapse_handle() {
return sprintf( '<div class="handlediv" title="%s"><br /></div>', esc_attr__( 'Click to toggle', 'fieldmanager' ) );
return '<span class="toggle-indicator" aria-hidden="true"></span>';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funny, so there was HTML markup for something, but it wasn't set to render anywhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't find it anywhere.

}

/**
Expand Down
5 changes: 4 additions & 1 deletion php/class-fieldmanager-group.php
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,10 @@ public function get_element_label( $classes = array() ) {
$wrapper_classes[] = 'fmjs-drag-header';
}

$collapse_handle = '';
if ( $this->collapsible ) {
$wrapper_classes[] = 'fmjs-collapsible-handle';
$collapse_handle = $this->get_collapse_handle();
}

$extra_attrs = '';
Expand All @@ -369,12 +371,13 @@ public function get_element_label( $classes = array() ) {
}

return sprintf(
'<div class="%1$s"><%2$s class="%3$s"%4$s>%5$s</%2$s>%6$s</div>',
'<div class="%1$s"><%2$s class="%3$s"%4$s>%5$s</%2$s>%6$s%7$s</div>',
esc_attr( implode( ' ', $wrapper_classes ) ),
$this->label_element,
esc_attr( implode( ' ', $classes ) ),
$extra_attrs,
$this->escape( 'label' ),
$collapse_handle,
$remove // get_remove_handle() is sanitized html
);
}
Expand Down