use data attribute data-sortable to toggle sorting

This commit is contained in:
Kathy Darling 2016-06-13 15:01:15 -05:00
parent 995b809cce
commit e670dc202b
1 changed files with 3 additions and 3 deletions

View File

@ -147,7 +147,7 @@ jQuery( function( $ ) {
$( this ).select2( select2_args ).addClass( 'enhanced' );
if( select2_args.multiple == true ){
if( $( this ).data( 'sortable' ) == true ){
$( this ).select2( 'container' ).find( 'ul.select2-choices' ).sortable({
containment: 'parent',
start: function() { $( this ).select2( 'onSortStart' ); },
@ -227,14 +227,14 @@ jQuery( function( $ ) {
$( this ).select2( select2_args ).addClass( 'enhanced' );
if( select2_args.multiple == true ){
if( $( this ).data( 'sortable' ) == true ){
$( this ).select2( 'container' ).find( 'ul.select2-choices' ).sortable({
containment: 'parent',
start: function() { $( this ).select2( 'onSortStart' ); },
update: function() { $( this ).select2( 'onSortEnd' ); }
});
}
});
})