diff --git a/BS3/assets/css/datatables.css b/BS3/assets/css/datatables.css index 44e05bb..bdeb179 100644 --- a/BS3/assets/css/datatables.css +++ b/BS3/assets/css/datatables.css @@ -1,24 +1,36 @@ -div.dataTables_length label { +html[direction='ltr'] div.dataTables_length label { float: left; text-align: left; } +html[direction='rtl'] div.dataTables_length label { + float: right; + text-align: right; +} div.dataTables_length select { width: 75px; } -div.dataTables_filter label { +html[direction='ltr'] div.dataTables_filter label { float: right; } +html[direction='rtl'] div.dataTables_filter label { + float: left; +} div.dataTables_info { padding-top: 26px; } div.dataTables_paginate { - float: right; margin: 0; } +html[direction='ltr'] div.dataTables_paginate { + float: right; +} +html[direction='rtl'] div.dataTables_paginate { + float: left; +} table.table { clear: both; @@ -35,12 +47,49 @@ table.table thead .sorting_desc_disabled { *cursor: hand; } -table.table thead .sorting { background: url('../images/sort_both.png') no-repeat center right; } -table.table thead .sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } -table.table thead .sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } - -table.table thead .sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } -table.table thead .sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } +/* + * Use Glyphicons Halflings from Bootstrap 3 instead of images. + * + * Relevant icons: + * + * Glyphicons Halflings (default) + * glyphicon-sort '\e150' sort + * glyphicon-sort-by-attributes '\e155' asc + * glyphicon-sort-by-attributes-alt '\e156' desc + * + * Font Awesome + * fa-sort '\f0dc' sort + * fa-caret-up '\f0d8' asc + * fa-caret-down '\f0d7' desc + */ +table.table thead .sorting:after, +table.table thead .sorting_asc:after, +table.table thead .sorting_desc:after, +table.table thead .sorting_asc_disabled:after, +table.table thead .sorting_desc_disabled:after { + font-family: 'Glyphicons Halflings'; +} +html[direction='ltr'] table.table thead .sorting:after, +html[direction='ltr'] table.table thead .sorting_asc:after, +html[direction='ltr'] table.table thead .sorting_desc:after, +html[direction='ltr'] table.table thead .sorting_asc_disabled:after, +html[direction='ltr'] table.table thead .sorting_desc_disabled:after { + text-align: right; + float: right; +} +html[direction='rtl'] table.table thead .sorting:after, +html[direction='rtl'] table.table thead .sorting_asc:after, +html[direction='rtl'] table.table thead .sorting_desc:after, +html[direction='rtl'] table.table thead .sorting_asc_disabled:after, +html[direction='rtl'] table.table thead .sorting_desc_disabled:after { + text-align: left; + float: left; +} +table.table thead .sorting:after { content: '\e150'; opacity: 0.2; } +table.table thead .sorting_asc:after { content: '\e155'; } +table.table thead .sorting_desc:after { content: '\e156'; } +table.table thead .sorting_asc_disabled:after { content: '\e155'; opacity: 0.2; } +table.table thead .sorting_desc_disabled:after { content: '\e156'; opacity: 0.2; } table.dataTable th:active { outline: none; diff --git a/BS3/assets/js/datatables.js b/BS3/assets/js/datatables.js index 3c6bdba..c19ea3f 100644 --- a/BS3/assets/js/datatables.js +++ b/BS3/assets/js/datatables.js @@ -9,11 +9,14 @@ /* Set the defaults for DataTables initialisation */ $.extend( true, $.fn.dataTable.defaults, { "sDom": "<'row'<'col-sm-12'<'pull-right'f><'pull-left'l>r<'clearfix'>>>t<'row'<'col-sm-12'<'pull-left'i><'pull-right'p><'clearfix'>>>", - "sPaginationType": "bs_normal", - "oLanguage": { - "sLengthMenu": "Show _MENU_ Rows", - "sSearch": "" - } + "sPaginationType": "bs_normal", + /* At the moment, this is the easiest way I could find to sneak these into oSettings without them getting wiped by _fnMap. */ + "oLanguage": { + "sIconClassFirst": "glyphicon glyphicon-backward", + "sIconClassLast": "glyphicon glyphicon-forward", + "sIconClassPrevious": "glyphicon glyphicon-chevron-left", + "sIconClassNext": "glyphicon glyphicon-chevron-right" + } } ); /* Default class modification */ @@ -50,8 +53,8 @@ }; $(nPaging).append( '