fixed textBlock insert

fixed tracking activeState.lastElement
This commit is contained in:
maru21 2023-09-17 14:03:47 +02:00
parent 0aec5b7625
commit be677cf9e0
18 changed files with 15 additions and 18 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.vscode
font-awesome
storage/*

View File

@ -58,7 +58,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
.w3-bar-block .w3-dropdown-hover .w3-dropdown-content,.w3-bar-block .w3-dropdown-click .w3-dropdown-content{min-width:100%} .w3-bar-block .w3-dropdown-hover .w3-dropdown-content,.w3-bar-block .w3-dropdown-click .w3-dropdown-content{min-width:100%}
.w3-bar-block .w3-dropdown-hover .w3-button,.w3-bar-block .w3-dropdown-click .w3-button{width:100%;text-align:left;padding:8px 16px} .w3-bar-block .w3-dropdown-hover .w3-button,.w3-bar-block .w3-dropdown-click .w3-button{width:100%;text-align:left;padding:8px 16px}
.w3-main,#main{transition:margin-left .4s} .w3-main,#main{transition:margin-left .4s}
.w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.6)} .w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.6);backdrop-filter: blur(6px);}
.w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} .w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px}
.w3-bar{width:100%;overflow:hidden}.w3-center .w3-bar{display:inline-block;width:auto} .w3-bar{width:100%;overflow:hidden}.w3-center .w3-bar{display:inline-block;width:auto}
.w3-bar .w3-bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0} .w3-bar .w3-bar-item{padding:8px 16px;float:left;width:auto;border:none;display:block;outline:0}

View File

@ -16,7 +16,7 @@
<link rel="stylesheet" href="css/font-awesome/css/all.min.css" /> <link rel="stylesheet" href="css/font-awesome/css/all.min.css" />
<link rel="stylesheet" href="css/styles.css" /> <link rel="stylesheet" href="css/styles.css" />
<script type="module" src="js/9.3/main.js"></script> <script type="module" src="js/9.4/main.js"></script>
<body> <body>
@ -40,9 +40,10 @@
> >
Show saved documents Show saved documents
</li> </li>
<!-- hidden since the data should only be stored on local machine -->
<li <li
class="w3-bar-item w3-padding-large w3-button" class="w3-bar-item w3-padding-large w3-button"
style="display: block; border-bottom: 2px solid rgb(221, 221, 221)" style="display: none; border-bottom: 2px solid rgb(221, 221, 221)"
id="importFilesSB" id="importFilesSB"
> >
Manage backup files Manage backup files

View File

@ -1,12 +1,3 @@
//class Form {
// constructor () {
// this.buildForm = buildForm;
// this.retrieveForm = retrieveForm;
// }
//
//
//
//}
import { storeData, createStorageObj } from "./storage.js"; import { storeData, createStorageObj } from "./storage.js";
import parseInput from "./parseTemplate.js"; import parseInput from "./parseTemplate.js";
@ -272,13 +263,15 @@ function formEvts() {
} }
}); });
//add handle on blur event listener //add handle on blur event listener to each form object
document.getElementById("mainForm").addEventListener("click", (e) => { let mainForm = document.getElementById("mainFormObj");
if (e.target && e.target.matches("div.w3-section")) { for (let formElement of mainForm.children) {
let id = formElement.firstChild.lastChild.id;
document.getElementById(id).addEventListener("blur", (e) => {
e.preventDefault; e.preventDefault;
handleOnBlur(e.target); handleOnBlur(e.target);
} });
}); }
} }
function focusOnField(id) { function focusOnField(id) {

View File

@ -122,7 +122,7 @@ function initTextBlocks() {
const divReg = document.getElementById("navTb"); const divReg = document.getElementById("navTb");
for (let x in res) { for (let x in res) {
if (res[x][1].length < 1) continue; if (res[x][1].length < 1) continue;
let aReg = document.createElement("a"); let aReg = document.createElement("a");
aReg.setAttribute("href", "#"); aReg.setAttribute("href", "#");
aReg.classList.add("w3-bar-item", "w3-hide-small", "w3-padding-small"); aReg.classList.add("w3-bar-item", "w3-hide-small", "w3-padding-small");