fix display editor

This commit is contained in:
Pierre Dubouilh
2019-02-07 23:02:24 +01:00
parent 8e2f79067e
commit c3a3966927
3 changed files with 16 additions and 6 deletions
+10 -4
View File
@@ -89,7 +89,7 @@ window.onClickLink = e => {
let softStatePushed
function pushSoftState (d) {
if (softStatePushed) { return }
softStatepushed = true
softStatePushed = true
history.pushState({}, '', encodeURI(d))
}
@@ -289,7 +289,7 @@ function padOff () {
saveText(() => {
clearInterval(window.padTimer)
window.onbeforeunload = null
editor.style.display = crossIcon.style.display = 'none'
resetView()
softPrev()
refresh()
}, () => {
@@ -325,6 +325,7 @@ async function displayPad (a) {
console.log('editing file', fileEdited)
editor.style.display = crossIcon.style.display = 'block'
table.style.display = 'none'
editor.focus()
window.onbeforeunload = warningMsg
window.padTimer = setInterval(saveText, 5000)
@@ -334,6 +335,11 @@ async function displayPad (a) {
window.displayPad = displayPad
// quit pictures or editor
function resetView () {
table.style.display = 'table'
editor.style.display = pics.style.display = crossIcon.style.display = 'none'
}
window.quitAll = () => picsOff() || padOff()
// Mkdir icon
@@ -447,6 +453,7 @@ function setImage () {
function picsOn (href) {
imgsIndex = allImgs.findIndex(el => el.includes(href))
setImage()
table.style.display = 'none'
crossIcon.style.display = 'block'
pics.style.display = 'flex'
pushSoftState(href.split('/').pop())
@@ -455,9 +462,8 @@ function picsOn (href) {
function picsOff () {
if (!isPicMode()) { return }
resetView()
softPrev()
pics.src = ''
pics.style.display = crossIcon.style.display = 'none'
return true
}