Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
70a5b4d
Sortable
mattheu Apr 24, 2013
15b7065
file field fixes
mattheu Apr 24, 2013
a21b2b0
group field fixes
mattheu Apr 24, 2013
d432535
only do sortable for direct children - avoid issues with sortable groups
mattheu Apr 27, 2013
3cd91d7
Merge branch 'refs/heads/master' into sortable-2013
mattheu Apr 27, 2013
d02693a
Merge branch 'refs/heads/master' into sortable-2013
mattheu Apr 27, 2013
ede4f59
bug fix. not unsetting var correctly
mattheu Apr 28, 2013
fd1e3da
button with href???
mattheu Apr 28, 2013
f798597
Comprehensive example file
mattheu Apr 28, 2013
cf42e29
Merge branch 'sortable-2013' of github.com:humanmade/Custom-Meta-Boxe…
mattheu Apr 28, 2013
7e5ada3
Merge branch 'refs/heads/master' into sortable-2013
mattheu Apr 28, 2013
3bc3afe
on load, set value for ajax post select
mattheu Apr 28, 2013
cdf45e0
example editor height
mattheu Apr 28, 2013
9932664
don't reinitialise tinyMCE after sorting if the editor is not set to …
mattheu Apr 30, 2013
24d4a4e
Merge branch 'refs/heads/master' into sortable-2013
mattheu May 3, 2013
7d93719
Merge branch 'refs/heads/master' into sortable-2013
mattheu Jun 5, 2013
001442f
Merge branch 'refs/heads/master' into sortable-2013
mattheu Oct 22, 2013
5517d55
prefix sortable classes
mattheu Oct 24, 2013
a24401f
add sortable placeholder
mattheu Oct 24, 2013
8fecd9d
missed some classes
mattheu Oct 24, 2013
ec85e5a
only trigger sortable on repeat for sortable fields
mattheu Oct 24, 2013
cf2ad6e
Image fields don't really need drag handles
mattheu Oct 24, 2013
c66052c
make all the buttons accessible
mattheu Oct 24, 2013
123207e
update sortable styles
mattheu Oct 28, 2013
3e0d7db
Merge branch 'refs/heads/master' into sortable-2013
mattheu Nov 1, 2013
90615a3
lost in the merge
mattheu Nov 1, 2013
1db4c82
more examples
mattheu Nov 1, 2013
f8dfc66
Merge branch 'refs/heads/master' into sortable-2013
mattheu Nov 8, 2013
6f14c87
style optimisations
mattheu Nov 8, 2013
e731cf7
more specific labelling
mattheu Nov 8, 2013
62e2261
Merge branch 'refs/heads/master' into sortable-2013
mattheu Nov 8, 2013
122de75
style should be specific for group.
mattheu Nov 11, 2013
bd11400
Merge branch 'refs/heads/master' into sortable-2013
mattheu Nov 19, 2013
192428c
Merge branch 'refs/heads/master' into sortable-2013
mattheu Nov 21, 2013
bc6bd2e
Merge branch 'refs/heads/master' into sortable-2013
mattheu Dec 2, 2013
1244fcf
fix version compare
mattheu Dec 3, 2013
8c2f853
Sortable MP6 styles
mattheu Dec 3, 2013
99a6b77
Recompile
mattheu Dec 3, 2013
e676af7
Merge branch 'refs/heads/master' into sortable-2013
mattheu Dec 5, 2013
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
10 changes: 9 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ module.exports = function(grunt) {
banner: '<%= banner %>'
},
files: {
'css/dist/cmb.min.css': [ 'css/src/layout.css', 'css/src/generic.css', 'css/src/repeatable.css', 'css/src/group.css', 'css/src/file.css', 'css/src/misc-fields.css' ]
'css/dist/cmb.min.css': [
'css/src/layout.css',
'css/src/generic.css',
'css/src/repeatable.css',
'css/src/sortable.css',
'css/src/group.css',
'css/src/file.css',
'css/src/misc-fields.css'
]
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion class.cmb-meta-box.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ function enqueue_styles() {

$suffix = CMB_DEV ? '' : '.min';

if ( version_compare( get_bloginfo( 'version' ), '3.7', '>' ) )
if ( version_compare( get_bloginfo( 'version' ), '3.7.1', '>' ) )
wp_enqueue_style( 'cmb-styles', trailingslashit( CMB_URL ) . "css/dist/cmb$suffix.css" );
else
wp_enqueue_style( 'cmb-styles', trailingslashit( CMB_URL ) . 'css/legacy.css' );
Expand Down Expand Up @@ -245,6 +245,9 @@ static function layout_fields( array $fields ) { ?>
if ( ! empty( $field->args['repeatable'] ) )
$classes[] = 'repeatable';

if ( ! empty( $field->args['sortable'] ) )
$classes[] = 'cmb-sortable';

$classes[] = get_class($field);

$classes = 'class="' . esc_attr( implode(' ', array_map( 'sanitize_html_class', $classes ) ) ) . '"';
Expand Down
6 changes: 5 additions & 1 deletion classes.fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ public function __construct( $name, $title, array $values, $args = array() ) {
* @uses wp_enqueue_script()
*/
public function enqueue_scripts() {

if ( isset( $this->args['sortable'] ) && $this->args['sortable'] )
wp_enqueue_script( 'jquery-ui-sortable' );

}

/**
Expand Down Expand Up @@ -1352,7 +1356,7 @@ public function display() {

</div>

<button class="button repeat-field"><?php esc_html_e( 'Add New', 'cmb' ); ?></button>
<button class="button repeat-field"><?php esc_html_e( 'Add New Group', 'cmb' ); ?></button>

<?php }

Expand Down
1 change: 1 addition & 0 deletions css/dist/cmb.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

/** Features **/
@import '../src/repeatable.css';
@import '../src/sortable.css';

/** Fields **/
@import '../src/group.css';
Expand Down
4 changes: 2 additions & 2 deletions css/dist/cmb.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading