Fix file selection

This commit is contained in:
2019-09-14 19:44:28 +05:30
parent 1103fd2bcd
commit c41bd4bd11

View File

@@ -42,22 +42,25 @@ async function postMV(oldLocation,newLocation){
///Call for onclick of elements ///Call for onclick of elements
function doUpdate(ele,isDir=false){ function doUpdate(ele,isDir=false){
console.log(ele.attr('data-choice')) //console.log(ele.attr('data-choice'))
///Check if succeeds if(!isDir){
postLS(ele.attr('data-choice')).then(e=>{ currSel.loc = ele.attr('data-choice')
if(ele.hasClass('file-isDir')){ $('.nav-bottom-text').html( (currSel.name = ele.html()) )
///Set as current directory }else{
currDir.loc=ele.attr('data-choice') ///Check if navigable directory
updateContents(e) postLS(ele.attr('data-choice')).then(e=>{
} if(ele.hasClass('file-isDir')){
if(!isDir){ ///Set as current directory
currSel.loc = ele.attr('data-choice') currDir.loc=ele.attr('data-choice')
$('.nav-bottom-text').html( (currSel.name = ele.html()).substring(7) +"..." ) updateContents(e)
} }
},
err=>{ },
console.log(`E:Something went wrong: ${JSON.stringify(err)}`) err=>{
}).finally() console.log(`E:Something went wrong: ${JSON.stringify(err)}`)
}).finally()
}
} }