From e670dc202b21b7007c1568de61b1d2e6b85c5b90 Mon Sep 17 00:00:00 2001 From: Kathy Darling Date: Mon, 13 Jun 2016 15:01:15 -0500 Subject: [PATCH] use data attribute data-sortable to toggle sorting --- assets/js/admin/wc-enhanced-select.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/admin/wc-enhanced-select.js b/assets/js/admin/wc-enhanced-select.js index ec548536d17..ed00e9541bc 100644 --- a/assets/js/admin/wc-enhanced-select.js +++ b/assets/js/admin/wc-enhanced-select.js @@ -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' ); } }); } - + }); })