cleanup
This commit is contained in:
parent
54514eaa25
commit
89a44377c9
@ -14,7 +14,7 @@ import setPassword, {
|
||||
} from "./scripts.js";
|
||||
import parseFormOnSubmit from "./parseForm.js";
|
||||
import { createStorageObj, storeSettings } from "./storage.js";
|
||||
import { loadNavBar, initTextBlocks } from "./web.js";
|
||||
import { loadNavBar, initTextBlocks, loadNewTemplate } from "./web.js";
|
||||
|
||||
window.activeState = {
|
||||
userId: "",
|
||||
@ -145,6 +145,22 @@ function eventListeners() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
//add url listener
|
||||
window.addEventListener("hashchange", (e) => {
|
||||
|
||||
let newURLArr = e.newURL.split("/");
|
||||
let template;
|
||||
if (newURLArr != undefined) {
|
||||
template = newURLArr[newURLArr.length -1];
|
||||
if (template != undefined) {
|
||||
template = template.split("=")[1];
|
||||
}
|
||||
}
|
||||
|
||||
console.log(template);
|
||||
//loadNewTemplate(template);
|
||||
});
|
||||
}
|
||||
|
||||
init();
|
||||
|
||||
@ -48,7 +48,6 @@ function loadTemplate(template, newFlag = false, loadOnly = false) {
|
||||
} else {
|
||||
cdata = retrieveData("userInputForce");
|
||||
}
|
||||
console.log(cdata);
|
||||
if (cdata != "") {
|
||||
if (cdata != null) {
|
||||
retrieveForm(cdata);
|
||||
@ -136,6 +135,7 @@ function loadNavBar() {
|
||||
|
||||
divMob.addEventListener("click", (e) => {
|
||||
if (e.target && e.target.matches("a.w3-bar-item")) {
|
||||
e.preventDefault;
|
||||
let template = e.target.dataset.template;
|
||||
if (template == "!createNew") {
|
||||
createTemplate();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user