Private GIT

Skip to content
Snippets Groups Projects
Commit f54d637a authored by Thraxis's avatar Thraxis
Browse files

FR#1419: Add Persistent Collapse Expand Buttons on Episode management

* Added Persistent Colllapse / Expand feature on Episode Management Page
parent 3b922e70
No related branches found
No related tags found
No related merge requests found
...@@ -9,7 +9,7 @@ $(document).ready(function() { ...@@ -9,7 +9,7 @@ $(document).ready(function() {
var row_class = $('#row_class').val(); var row_class = $('#row_class').val();
var row = ''; var row = '';
row += ' <tr class="'+row_class+'">'; row += ' <tr class="'+row_class+' show-'+indexer_id+'">';
row += ' <td class="tableleft" align="center"><input type="checkbox" class="'+indexer_id+'-epcheck" name="'+indexer_id+'-'+season+'x'+episode+'"'+checked+'></td>'; row += ' <td class="tableleft" align="center"><input type="checkbox" class="'+indexer_id+'-epcheck" name="'+indexer_id+'-'+season+'x'+episode+'"'+checked+'></td>';
row += ' <td>'+season+'x'+episode+'</td>'; row += ' <td>'+season+'x'+episode+'</td>';
row += ' <td class="tableright" style="width: 100%">'+name+'</td>'; row += ' <td class="tableright" style="width: 100%">'+name+'</td>';
...@@ -27,7 +27,10 @@ $(document).ready(function() { ...@@ -27,7 +27,10 @@ $(document).ready(function() {
var cur_indexer_id = $(this).attr('id'); var cur_indexer_id = $(this).attr('id');
var checked = $('#allCheck-'+cur_indexer_id).prop('checked'); var checked = $('#allCheck-'+cur_indexer_id).prop('checked');
var last_row = $('tr#'+cur_indexer_id); var last_row = $('tr#'+cur_indexer_id);
var clicked = $(this).attr('data-clicked');
var action = $(this).attr('value');
if (!clicked) {
$.getJSON(sbRoot+'/manage/showEpisodeStatuses', $.getJSON(sbRoot+'/manage/showEpisodeStatuses',
{ {
indexer_id: cur_indexer_id, indexer_id: cur_indexer_id,
...@@ -41,7 +44,19 @@ $(document).ready(function() { ...@@ -41,7 +44,19 @@ $(document).ready(function() {
}); });
}); });
}); });
$(this).hide(); $(this).attr('data-clicked',1);
$(this).prop('value', 'Collapse');
} else {
if (action === 'Collapse') {
$('table tr').filter('.show-'+cur_indexer_id).hide();
$(this).prop('value', 'Expand');
}
else if (action === 'Expand') {
$('table tr').filter('.show-'+cur_indexer_id).show();
$(this).prop('value', 'Collapse');
}
}
}); });
// selects all visible episode checkboxes. // selects all visible episode checkboxes.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment