Skip to content

Commit

Permalink
now settings can be remembered on app start
Browse files Browse the repository at this point in the history
  • Loading branch information
John4650-hub committed Sep 14, 2023
1 parent b030e24 commit 9a891e7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions www/js/components/main_FileEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export async function onDeviceReady() {
})
if (checkValidity == undefined) {
workWithFile(fileTruePath);
addRecentlyOpenedFile(filename,fileTruePath)
addRecentlyOpenedFile(filename,fileTruePath,FILE_EXTENSIONS[extension])
window.aceEditor.session.setMode(`ace/mode/${FILE_EXTENSIONS[extension]}`)

} else {
Expand Down Expand Up @@ -110,11 +110,13 @@ export async function onDeviceReady() {
}, () => { console.log('failed to save file'); });
}

function addRecentlyOpenedFile(name,url) {
function addRecentlyOpenedFile(name,url,ext) {
let openedFile = makeElm('li')
insertAttr(['class=list-group-item'], openedFile)
openedFile.innerText = name
openedFile.addEventListener('click', function() { workWithFile(url) })
openedFile.addEventListener('click', function() { workWithFile(url)
window.aceEditor.session.setMode(`ace/mode/${ext}`)
})

recentFilesTab.appendChild(openedFile)
}
Expand Down

0 comments on commit 9a891e7

Please sign in to comment.