(function (paw) {
    function DomUtils() {
        // horizontal breakpoints
        this.responsiveBreakpointsH = {
            'tablet-mobile': 991.98 // equals $max-screen-sm css breakpoint
        };
    }

    DomUtils.prototype.reverseElementsOrder = function ($container, $elts) {
        if ($elts.length === 0) return;

        var reversed = $elts.get().reverse();
        $container.append(reversed);  
    };

    DomUtils.prototype.isTabletOrMobileWidth = function(){
        return $(document).innerWidth() <= this.responsiveBreakpointsH['tablet-mobile'];
    };
    
    DomUtils.prototype.sortElements = function($container, $elts, sortCondition, asc){
        var orderAsc = asc !== false;
        var orderModifier = orderAsc? 1 : -1;
        var sorted = $elts.sort(function(a, b){
            return sortCondition($(a), $(b)) * orderModifier;
        });
        $container.append(sorted);
    };

    paw.utils.dom = new DomUtils();
})(paw);