Commit 9755f81 1 parent 94684a0 commit 9755f81 Copy full SHA for 9755f81
File tree 1 file changed +0
-46
lines changed
1 file changed +0
-46
lines changed Original file line number Diff line number Diff line change 709
709
} ) ;
710
710
}
711
711
712
- function sortDataOld ( data , sort ) {
713
- if ( ! Array . isArray ( sort ) )
714
- sort = [ sort ]
715
- for ( let i = 0 ; i < sort . length ; i ++ ) {
716
- let key = sort [ i ] . key
717
- if ( key ) {
718
- try {
719
- data . sort ( ( a , b ) => {
720
- if ( sort [ i ] . direction == 'desc' ) {
721
- switch ( typeof b [ key ] ) {
722
- case 'string' :
723
- if ( ! b [ key ] )
724
- b [ key ] = ""
725
- return b [ key ] . localeCompare ( a [ key ] )
726
- case 'number' :
727
- if ( ! b [ key ] )
728
- b [ key ] = 0
729
- return b [ key ] - a [ key ]
730
- case 'array' :
731
- case 'object' :
732
- break ;
733
- }
734
- } else {
735
- switch ( typeof a [ key ] ) {
736
- case 'string' :
737
- if ( ! a [ key ] )
738
- a [ key ] = ""
739
- return a [ key ] . localeCompare ( b [ key ] )
740
- case 'number' :
741
- if ( ! a [ key ] )
742
- a [ key ] = 0
743
- return a [ key ] - b [ key ]
744
- case 'array' :
745
- case 'object' :
746
- break ;
747
- }
748
- }
749
- } ) ;
750
- } catch ( error ) {
751
- console . log ( error )
752
- }
753
- }
754
- }
755
- return data ;
756
- }
757
-
758
712
function getAttributes ( el ) {
759
713
if ( ! el ) return ;
760
714
You can’t perform that action at this time.
0 commit comments