Docker list: Remove separate collapsed button and combine with view button

This commit is contained in:
bergware
2018-03-08 20:21:59 +01:00
parent 7c6dd9183e
commit 3e38a6f5d2
@@ -49,7 +49,7 @@ th.three{width:3%}
</form>
<div id="dialog-confirm" style="display:none;" title="Dialog Title"></div>
<div id="iframe-popup" style="display:none;-webkit-overflow-scrolling:touch;"></div>
<span class="status" style="margin-top:-44px"><span style="float:right;margin-left:48px"><input type="checkbox" class="advancedview"></span><span style="float:right"><input type="checkbox" class="expandedlist"></span></span>
<span class="status" style="margin-top:-44px"><span><input type="checkbox" class="advancedview"></span></span>
<table class="tablesorter shift" id="docker_containers">
<thead><tr><th></th><th>Application</th><th>Version</th><th>Network</th><th>Port Mappings <small>(App to Host)</small></th><th>Volume Mappings <small>(App to Host)</small></th><th width="80px" style="text-align:center">Autostart</th><th class="three">Log</th></tr></thead>
<tbody id="docker_list"><tr><td colspan='8' style='text-align:center;padding-top:12px'><i class='fa fa-spinner fa-spin icon'></i>Please wait... retrieving container information</td></tr></tbody>
@@ -86,7 +86,7 @@ function resize(bind) {
}
<?endif;?>
function listview() {
if ($.cookie('docker_list_mode')=='collapsed') {
if ($.cookie('docker_listview_mode')=='basic') {
$('.docker_readmore').readmore({maxHeight:32,moreLink:"<a href='#' style='text-align:center'><i class='fa fa-chevron-down'></i></a>",lessLink:"<a href='#' style='text-align:center'><i class='fa fa-chevron-up'></i></a>"});
} else {
$('.docker_readmore').readmore('destroy');
@@ -110,22 +110,18 @@ function loadlist() {
textExtraction:{6:function(node,table,cellIndex){return $(node).find('input').prop('checked')?1:0;}}
});
if ($.cookie('docker_listview_mode')=='advanced') {$('.advanced').show(); $('.basic').hide();}
context.init({preventDoubleContext:false});
listview();
context.init({preventDoubleContext:false});
$('input[type=button]').prop('disabled',false);
});
}
$(function() {
$('.expandedlist').switchButton({labels_placement:'left', on_label:'Collapsed List', off_label:'Expanded List', checked:$.cookie('docker_list_mode')=='collapsed'});
$('.expandedlist').change(function() {
$.cookie('docker_list_mode',$('.expandedlist').is(':checked')?'collapsed':'expanded',{expires:3650});
listview();
});
$('.advancedview').switchButton({labels_placement:'left', on_label:'Advanced View', off_label:'Basic View', checked:$.cookie('docker_listview_mode')=='advanced'});
$('.advancedview').change(function() {
$('.advanced').toggle('slow');
$('.basic').toggle('slow');
$.cookie('docker_listview_mode',$('.advancedview').is(':checked')?'advanced':'basic',{expires:3650});
listview();
});
loadlist();
});