mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-26 01:27:07 +00:00
Added seasons collapsing to episodes view.
This commit is contained in:
parent
a3723a1437
commit
11d93f61db
1 changed files with 20 additions and 2 deletions
|
@ -323,6 +323,8 @@
|
|||
getLanguages();
|
||||
getEnabledLanguages();
|
||||
|
||||
var collapsedGroups = {};
|
||||
|
||||
var table = $('#episodes').DataTable({
|
||||
dom: "tr",
|
||||
processing: true,
|
||||
|
@ -338,8 +340,18 @@
|
|||
pageLength: {{ settings.general.page_size }},
|
||||
ajax: "{{ url_for('api.episodes') }}?seriesid={{id}}",
|
||||
rowGroup: {
|
||||
dataSrc: function (data) {
|
||||
return 'Season ' + data.season;
|
||||
dataSrc: 'season',
|
||||
startRender: function (rows, group) {
|
||||
var collapsed = !!collapsedGroups[group];
|
||||
|
||||
rows.nodes().each(function (r) {
|
||||
r.style.display = collapsed ? 'none' : '';
|
||||
});
|
||||
|
||||
return $('<tr/>')
|
||||
.append('<td colspan=' + rows.columns()[0].length + '>Season ' + group + '</td>')
|
||||
.attr('data-name', group)
|
||||
.toggleClass('collapsed', collapsed);
|
||||
}
|
||||
},
|
||||
columns: [
|
||||
|
@ -424,6 +436,12 @@
|
|||
]
|
||||
});
|
||||
|
||||
$('#episodes').on('click', 'tr.dtrg-start', function () {
|
||||
var name = $(this).data('name');
|
||||
collapsedGroups[name] = !collapsedGroups[name];
|
||||
table.draw(false);
|
||||
});
|
||||
|
||||
$('#episodes').on('click', '.remove_subtitles', function (e) {
|
||||
$(this).tooltip('dispose');
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue