Skip to content

Commit d76e2d6

Browse files
author
Marius Cramer
committed
- re-added table sorting
1 parent bbb85a4 commit d76e2d6

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

interface/web/themes/default/assets/javascripts/ispconfig.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,18 @@ $(document).on('click', 'th[data-column]', function(e) {
633633
var act = $el.attr('data-form-action');
634634
var form = $el.attr('data-submit-form');
635635

636+
var dir = $self.attr('data-ordered');
637+
636638
act = act + '?orderby=' + column;
637639
ISPConfig.submitForm(form, act);
640+
641+
$(document).ajaxComplete(function() {
642+
var $self = $('#pageForm .table th[data-column="' + column + '"]');
643+
$self.parent().children('th[data-column]').removeAttr('data-ordered');
644+
if(dir && dir == 'asc') $self.attr('data-ordered', 'desc');
645+
else $self.attr('data-ordered', 'asc');
646+
});
647+
638648
}
639649
});
640650

interface/web/themes/default/assets/javascripts/ispconfig.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

interface/web/themes/default/assets/stylesheets/ispconfig.css

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,37 @@ thead.dark th.tiny-col {
271271
overflow: hidden;
272272
text-overflow: ellipsis; }
273273

274+
thead.dark th[data-column] {
275+
cursor: pointer;
276+
}
277+
278+
thead.dark th[data-column][data-ordered] {
279+
font-weight: bold;
280+
position: relative;
281+
}
282+
283+
thead.dark th[data-column][data-ordered]:before {
284+
content: "";
285+
display: block;
286+
position: absolute;
287+
right: 5px;
288+
top: 16px;
289+
width: 0;
290+
height: 0;
291+
vertical-align: middle;
292+
border-bottom: 5px solid #fff;
293+
border-top: 5px solid transparent;
294+
border-right: 5px solid transparent;
295+
border-left: 6px solid transparent;
296+
line-height: inherit;
297+
}
298+
299+
thead.dark th[data-column][data-ordered="desc"]:before {
300+
top: 21px;
301+
border-bottom: 5px solid transparent;
302+
border-top: 5px solid #fff;
303+
}
304+
274305
thead.dark td input,
275306
thead.dark td select {
276307
width: 100%; }

interface/web/themes/default/assets/stylesheets/ispconfig.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)