aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorCamil Staps2015-02-15 11:40:59 +0100
committerCamil Staps2015-02-15 11:40:59 +0100
commited81201142ca2d47c652d91ed871687c8d64d8fa (patch)
tree28bcb4aaa9a2ce71c6c94f1b8b79bdaee211cc36 /js
parentScrollbar for wide tables (diff)
Added sorting indicators
Diffstat (limited to 'js')
-rw-r--r--js/businessadmin.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/js/businessadmin.js b/js/businessadmin.js
index fecd18a..956b371 100644
--- a/js/businessadmin.js
+++ b/js/businessadmin.js
@@ -63,6 +63,7 @@ $(document).ready(function(){
// Use the MixItUp plugin for sorting tables
$('.mixitup').mixItUp({
animation: {
+ duration: 200,
effects: 'fade'
},
layout: {
@@ -70,15 +71,15 @@ $(document).ready(function(){
}
});
$('.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).closest('.mixitup').mixItUp('sort', $(this).data('sort'));
+ var sorting = $(this).data('sort').substring($(this).data('sort').indexOf(':') + 1);
- $(this).parent().find('.mixitup-sort').removeClass('active');
- $(this).addClass('active');
+ $(this).parent().find('.mixitup-sort').removeClass('active sorting_asc sorting_desc').addClass('sorting');
+ $(this).addClass('active sorting_' + sorting).removeClass('sorting');
});
}); \ No newline at end of file