assets/js/pie/jquery.jchart.js
/*
         * Sort an array containing DOM elements by their position in the document (top to bottom)
         */
Sort an array containing DOM elements by their position in the document (top to bottom)
Sort an array containing DOM elements by their position in the document ( top to bottom )
objSortByPositionInDOM(input, attr, attr2) {
            let _input = input;
            let output;
            if (attr && attr2) {
                output = _input.sort(function (a, b) {
                    if (a[attr][attr2][0] === b[attr][attr2][0]) return 0;
                    if (!a[attr][attr2][0].compareDocumentPosition) {
                        return a[attr][attr2][0].sourceIndex - b[attr][attr2][0].sourceIndex;
                    }
                    if (a[attr][attr2][0].compareDocumentPosition(b[attr][attr2][0]) & 2) {
                        return 1;
                    }
                    return -1;
                });
            }
            else if (attr) {
                output = _input.sort(function (a, b) {
                    if (a[attr][0] === b[attr][0]) return 0;
                    if (!a[attr][0].compareDocumentPosition) {
                        return a[attr][0].sourceIndex - b[attr][0].sourceIndex;
                    }
                    if (a[attr][0].compareDocumentPosition(b[attr][0]) & 2) {
                        return 1;
                    }
                    return -1;
                });
            } else {
                output = _input.sort(function (a, b) {
                    if (a[0] === b[0]) return 0;
                    if (!a[0].compareDocumentPosition) {
                        return a[0].sourceIndex - b[0].sourceIndex;
                    }
                    if (a[0].compareDocumentPosition(b[0]) & 2) {
                        return 1;
                    }
                    return -1;
                });
            }
            return output;
        }
objSortByPositionInDOM ( input , attr , attr2 ) { let _input = input ; let output ; if ( attr && attr2 ) { output = _input . sort ( function ( a , b ) { if ( a [ attr ] [ attr2 ] [ 0 ] === b [ attr ] [ attr2 ] [ 0 ] ) return 0 ; if ( ! a [ attr ] [ attr2 ] [ 0 ] . compareDocumentPosition ) { return a [ attr ] [ attr2 ] [ 0 ] . sourceIndex - b [ attr ] [ attr2 ] [ 0 ] . sourceIndex ; } if ( a [ attr ] [ attr2 ] [ 0 ] . compareDocumentPosition ( b [ attr ] [ attr2 ] [ 0 ] ) & 2 ) { return 1 ; } return - 1 ; } ) ; } else if ( attr ) { output = _input . sort ( function ( a , b ) { if ( a [ attr ] [ 0 ] === b [ attr ] [ 0 ] ) return 0 ; if ( ! a [ attr ] [ 0 ] . compareDocumentPosition ) { return a [ attr ] [ 0 ] . sourceIndex - b [ attr ] [ 0 ] . sourceIndex ; } if ( a [ attr ] [ 0 ] . compareDocumentPosition ( b [ attr ] [ 0 ] ) & 2 ) { return 1 ; } return - 1 ; } ) ; } else { output = _input . sort ( function ( a , b ) { if ( a [ 0 ] === b [ 0 ] ) return 0 ; if ( ! a [ 0 ] . compareDocumentPosition ) { return a [ 0 ] . sourceIndex - b [ 0 ] . sourceIndex ; } if ( a [ 0 ] . compareDocumentPosition ( b [ 0 ] ) & 2 ) { return 1 ; } return - 1 ; } ) ; } return output ; }
Sort an array containing DOM elements by their position in the document (top to bottom)
Sort an array containing DOM elements by their position in the document ( top to bottom )
//sort by position in DOM // support for IE8 and below // b comes before a // support for IE8 and below // b comes before a // support for IE8 and below // b comes before a