add prettier and null responses
This commit is contained in:
@@ -11,6 +11,10 @@
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chrisvrose/nodejs-fm.git"
|
||||
},
|
||||
"prettier":{
|
||||
"tabWidth": 4,
|
||||
"semi": true
|
||||
},
|
||||
"keywords": [
|
||||
"file-manager",
|
||||
"file-viewer"
|
||||
|
@@ -84,9 +84,13 @@ function updateContents(contentResponse){
|
||||
$('#files-table').append(`<tr><td>null</td><td class="file-handlers"></td></tr>`)
|
||||
}else{
|
||||
$('#files-table').hide().empty();
|
||||
if(contentResponse.contents.length===0){
|
||||
$('#files-table').append(`<tr class="files-row"><td>...No files...</td></tr>`);
|
||||
}else{
|
||||
contentResponse.contents.forEach(element => {
|
||||
$('#files-table').append(`<tr class="files-row box-shadow-1-active"><td onclick="doUpdate($(this),${element.isDir})" class="file-name ${(element.isDir?'file-isDir':'file-isFile')}" data-choice="${element.path}">${element.name}</td></tr>`)
|
||||
});
|
||||
}
|
||||
if(contentResponse.back!==null){
|
||||
$('#files-table').prepend(`<tr class="files-row box-shadow-1-active"><td onclick="doUpdate($(this),true)" class="file-name file-isDir file-isBack" data-choice="${contentResponse.back}">..</td></tr>`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user