From http://bootsnipp.com/snipps/advanced-sort-modal