Skip to content

Commit

Permalink
make folder names clickable
Browse files Browse the repository at this point in the history
  • Loading branch information
briehl committed Oct 8, 2020
1 parent 55a855e commit 94e5089
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions kbase-extension/static/kbase/css/kbaseNarrative.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
text-overflow: ellipsis;
}

.kb-data-staging-table-name > .kb-data-staging-folder:hover {
cursor: pointer;
text-decoration: underline;
}

.kb-data-staging-footer {
font-family : Oxygen, Arial, sans-serif;
font-weight: bold;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ define([
if (isFolder) {
disp = '<button data-name="' + full[1] + '" class="btn btn-xs btn-default">' + disp + '</button>';
} else {
disp = "<i class='fa fa-caret-right' data-caret='" + full[1] + "' style='cursor : pointer'></i> " + disp;
disp = '<i class="fa fa-caret-right" data-caret="' + full[1] + '" style="cursor : pointer"></i> ' + disp;
}
return disp;
} else {
Expand All @@ -283,12 +283,18 @@ define([
aTargets: [1],
sClass: 'staging-name',
mRender: function (data, type, full) {
console.log(data);
console.log(full[0]);
if (type === 'display') {

var decompressButton = '';

if (data.match(/\.(zip|tar\.gz|tgz|tar\.bz|tar\.bz2|tar|gz|bz2)$/)) {
decompressButton = "<button class='btn btn-default btn-xs' style='border : 1px solid #cccccc; border-radius : 1px' data-decompress='" + data + "'><i class='fa fa-expand'></i></button> ";
decompressButton = '<button class="btn btn-default btn-xs" style="border : 1px solid #cccccc; border-radius : 1px" data-decompress="' + data + '><i class="fa fa-expand"></i></button> ';
}

if (full[0] === 'true') {
data = '<span class="kb-data-staging-folder" data-name="' + data + '">' + data + '</span>';
}

return '<div class="kb-data-staging-table-name">' + decompressButton +
Expand Down Expand Up @@ -333,6 +339,10 @@ define([
hide: Config.get('tooltip').hideDelay
}
});
$('td:eq(1)', nRow).find('span.kb-data-staging-folder').off('click').on('click', e => {
$(e.currentTarget).off('click');
this.updatePathFn(this.path += '/' + $(e.currentTarget).data().name);
});
$('td:eq(4)', nRow).find('select').select2({
placeholder: 'Select format'
});
Expand Down Expand Up @@ -367,6 +377,7 @@ define([


$('td:eq(0)', nRow).find('button[data-name]').off('click').on('click', e => {
$(e.currentTarget).off('click');
this.updatePathFn(this.path += '/' + $(e.currentTarget).data().name);
});

Expand Down

0 comments on commit 94e5089

Please sign in to comment.