diff options
Diffstat (limited to 'js/businessadmin.js')
-rw-r--r-- | js/businessadmin.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/js/businessadmin.js b/js/businessadmin.js index 1a682d6..fecd18a 100644 --- a/js/businessadmin.js +++ b/js/businessadmin.js @@ -59,4 +59,26 @@ $(document).ready(function(){ // Use the bootstrap-select plugin on all selects $('select').selectpicker(); + + // Use the MixItUp plugin for sorting tables + $('.mixitup').mixItUp({ + animation: { + effects: 'fade' + }, + layout: { + display: 'table-row' + } + }); + $('.mixitup .mixitup-sort').click(function(){ + $(this).closest('.mixitup').mixItUp('sort', $(this).data('sort')); + + var mapping = { + desc: 'asc', + asc: 'desc' + } + $(this).data('sort', $(this).data('sort').replace(/asc|desc/gi, function(m){ return mapping[m]; })); + + $(this).parent().find('.mixitup-sort').removeClass('active'); + $(this).addClass('active'); + }); });
\ No newline at end of file |