added popdown and autofocus to command palette
@@ -26,12 +26,23 @@ function doSub() {
);
}
+var palette = false;
+
window.addEventListener("message", (event) => {
let popup = document.getElementById("popup");
let input = document.getElementById("input");
+ if (palette) {
+ palette = false;
+ popup.style = "display:hidden;";
+ input.style = "visibility:hidden !important;";
+ input.value = "";
+ } else {
+ palette = true;
+
popup.style = "position:absolute; left: 0; top: 0; display:block; width: 100%; height: 100%; margin: 0 0; background-color:white;";
input.style = "";
+ input.focus();
input.addEventListener("keyup", (e) => {
if (e.keyCode !== 13) { return; }
popup.style = "display:hidden;";
@@ -50,8 +61,7 @@ window.addEventListener("message", (event) => {
);
});
-
-
+ }
});
setFrame();
