Fix file selection

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

View File

@@ -42,24 +42,27 @@ 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){
currSel.loc = ele.attr('data-choice')
$('.nav-bottom-text').html( (currSel.name = ele.html()) )
}else{
///Check if navigable directory
postLS(ele.attr('data-choice')).then(e=>{ postLS(ele.attr('data-choice')).then(e=>{
if(ele.hasClass('file-isDir')){ if(ele.hasClass('file-isDir')){
///Set as current directory ///Set as current directory
currDir.loc=ele.attr('data-choice') currDir.loc=ele.attr('data-choice')
updateContents(e) updateContents(e)
} }
if(!isDir){
currSel.loc = ele.attr('data-choice')
$('.nav-bottom-text').html( (currSel.name = ele.html()).substring(7) +"..." )
}
}, },
err=>{ err=>{
console.log(`E:Something went wrong: ${JSON.stringify(err)}`) console.log(`E:Something went wrong: ${JSON.stringify(err)}`)
}).finally() }).finally()
} }
}
///Populate contents ///Populate contents
function updateContents(contentResponse){ function updateContents(contentResponse){