pixflow-auth-motionfactory-theme
Advanced tools
Comparing version 1.2.1 to 1.2.2
26
index.js
@@ -13,3 +13,3 @@ const PixflowControllerAuth = require("pixflow-controller-auth"); | ||
connectedCallback(){ | ||
async connectedCallback(){ | ||
this.import_file(); | ||
@@ -21,4 +21,28 @@ this.querySelector("div.error button").addEventListener("click", e => { | ||
}) | ||
if(await this.connect()){ | ||
document.querySelector("pixflow-auth > div > div.loading").classList.remove("active"); | ||
} else { | ||
this.message_box("error"); | ||
} | ||
} | ||
message_box(mode){ | ||
let message = this.querySelector("div.message"); | ||
let timeout = message.querySelector(`div.${mode} > p`).innerHTML.split(" ").length * 2000; | ||
message.querySelectorAll("div.active").forEach(function(element){ | ||
element.classList.remove("active"); | ||
}) | ||
let branch = message.querySelector(`div.${mode}`); | ||
message.classList.add("active"); | ||
branch.classList.add("active"); | ||
if(mode == "error"){ | ||
message.classList.toggle(mode); | ||
} else { | ||
setTimeout(function(){ | ||
message.classList.remove("active"); | ||
branch.classList.remove("active"); | ||
}, timeout); | ||
} | ||
} | ||
import_file(){ | ||
@@ -25,0 +49,0 @@ const self = this; |
{ | ||
"name": "pixflow-auth-motionfactory-theme", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
270198
18
325