diff options
author | Camil Staps | 2015-02-15 11:40:59 +0100 |
---|---|---|
committer | Camil Staps | 2015-02-15 11:40:59 +0100 |
commit | ed81201142ca2d47c652d91ed871687c8d64d8fa (patch) | |
tree | 28bcb4aaa9a2ce71c6c94f1b8b79bdaee211cc36 | |
parent | Scrollbar for wide tables (diff) |
Added sorting indicators
-rw-r--r-- | css/businessadmin.css | 4 | ||||
-rw-r--r-- | include/assignments-overview.php | 10 | ||||
-rw-r--r-- | include/clients-overview.php | 6 | ||||
-rw-r--r-- | include/contacts-overview.php | 6 | ||||
-rw-r--r-- | js/businessadmin.js | 9 |
5 files changed, 20 insertions, 15 deletions
diff --git a/css/businessadmin.css b/css/businessadmin.css index 3f8b06f..da70bf8 100644 --- a/css/businessadmin.css +++ b/css/businessadmin.css @@ -50,6 +50,10 @@ body { display: none; } +th.sorting, th.sorting_asc, th.sorting_desc { + min-width: 50px; +} + td { /*vertical-align: middle !important;*/ line-height: 1.428571429 !important; diff --git a/include/assignments-overview.php b/include/assignments-overview.php index 2881987..a21408e 100644 --- a/include/assignments-overview.php +++ b/include/assignments-overview.php @@ -22,14 +22,14 @@ <div class="panel panel-default"> <div class="panel-heading">Overview</div> <div class="panel-body table-responsive"> - <table class="table table-bordered table-striped mixitup" id="overview-assignments"> + <table class="table table-bordered table-striped mixitup dataTable" id="overview-assignments"> <thead> <tr> - <th class="mixitup-sort" data-sort="mixerOrderId:asc">#</th> - <th class="mixitup-sort" data-sort="mixerOrderOffer:asc">Offer</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderOffer:desc">Offer</th> <th>Briefing</th> - <th class="mixitup-sort" data-sort="mixerOrderTime:asc">Time</th> - <th class="mixitup-sort" data-sort="mixerOrderPrice:asc">Price</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderTime:desc">Time</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderPrice:desc">Price</th> <th>Tools</th> </tr> </thead> diff --git a/include/clients-overview.php b/include/clients-overview.php index a238ab1..f3e2a24 100644 --- a/include/clients-overview.php +++ b/include/clients-overview.php @@ -22,11 +22,11 @@ <div class="panel panel-default"> <div class="panel-heading">Overview</div> <div class="panel-body table-responsive"> - <table class="table table-bordered table-striped mixitup" id="overview-clients"> + <table class="table table-bordered table-striped mixitup dataTable" id="overview-clients"> <thead> <tr> - <th class="mixitup-sort" data-sort="mixerOrderId:asc">#</th> - <th class="mixitup-sort" data-sort="mixerOrderName:asc">Name</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderName:desc">Name</th> <th>Tools</th> </tr> </thead> diff --git a/include/contacts-overview.php b/include/contacts-overview.php index 8548e3e..cd3b1bc 100644 --- a/include/contacts-overview.php +++ b/include/contacts-overview.php @@ -22,11 +22,11 @@ <div class="panel panel-default"> <div class="panel-heading">Overview</div> <div class="panel-body table-responsive"> - <table class="table table-bordered table-striped mixitup" id="overview-contacts"> + <table class="table table-bordered table-striped mixitup dataTable" id="overview-contacts"> <thead> <tr> - <th class="mixitup-sort" data-sort="mixerOrderId:asc">#</th> - <th class="mixitup-sort" data-sort="mixerOrderName:asc">Name</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderId:desc">#</th> + <th class="mixitup-sort sorting" data-sort="mixerOrderName:desc">Name</th> <th>Address</th> <th>Tools</th> </tr> 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 |