Etemplate - better formatting for display of linked files in sub-directories

This commit is contained in:
nathangray 2019-04-25 11:37:39 -06:00
parent 387f00d1a7
commit 64a0ec9c02

View File

@ -2144,7 +2144,7 @@ var et2_link_list = (function(){ "use strict"; return et2_link_string.extend(
// VFS link - check for same dir as above, and hide dir // VFS link - check for same dir as above, and hide dir
var reformat = false; var reformat = false;
var span_size = 0.3; var span_size = 1;
var prev = jQuery('td.title',$td.parent().prev('tr')); var prev = jQuery('td.title',$td.parent().prev('tr'));
if(prev.length === 1) if(prev.length === 1)
{ {
@ -2167,16 +2167,16 @@ var et2_link_list = (function(){ "use strict"; return et2_link_string.extend(
} }
} }
} }
if(reformat) var filename = dirs.pop();
if(reformat && dirs.length === 1)
{ {
$td.html('<span style="display: inline-block; width:'+span_size+'ex;"></span> - '+dirs.join('')); $td.html('<span style="display: inline-block; width:'+span_size+'ex;"></span> - '+dirs.join(''));
} }
else else
{ {
// Different format for directory // Different format for directory
var filename = dirs.pop();
span_size += dirs.join('/').length+1; span_size += dirs.join('/').length+1;
$td.html('<span style="display: inline-block; width:'+span_size+'ex;">'+dirs.join('/')+':</span> - ' + filename); $td.html('<span style="display: inline-block; text-align: right; width:'+span_size+'ex;">'+dirs.join('/')+':</span> - ' + filename);
} }
} }
});}).call(this); });}).call(this);