diff --git a/stear/extra/Pages/showStatus.js b/stear/extra/Pages/showStatus.js index 2512b99..4c97988 100644 --- a/stear/extra/Pages/showStatus.js +++ b/stear/extra/Pages/showStatus.js @@ -15,7 +15,7 @@ Stear.addGlobalStyleJSON({ transition: "background-color 200ms", backgroundColor: "#212121", color:"#fafafa", - "-webkit-user-select": "none", + webkitUserSelect: "none", },".stear_status"); diff --git a/stear/main.js b/stear/main.js index ac52aee..2902dc0 100644 --- a/stear/main.js +++ b/stear/main.js @@ -122,9 +122,9 @@ export class SFrame{ export class SWindow extends SFrame{ - #Frame + #Frame; - constructor({ preRender, render, call }){ + constructor({ preRender, render, call, backgroundColor = "transparent"}){ var Frame = _({ style: { top: "0px", @@ -132,8 +132,11 @@ export class SWindow extends SFrame{ position: "absolute", height: "100%", width: "100%", - display: "block" - } + display: "block", + backgroundColor, + overflow:"scroll" + }, + find:"main" }, []); super({ preRender, render: (settings, args) => { diff --git a/stear/utils.js b/stear/utils.js index a029291..f9e6adf 100644 --- a/stear/utils.js +++ b/stear/utils.js @@ -37,3 +37,25 @@ export const fadein = async (elems, ms = 200, force = false) => { } await wait(ms); } + +var bStack = []; +export const subCancel = (callback) => { + bStack.push(callback); + return ()=>{ + var id; + if ((id = bStack.indexOf(callback)) >= 0) { + bStack.splice(id, 1); + } + } +} + +function back() { + if (bStack.length) { + bStack.pop()(); + } +} + +document.addEventListener("backbutton", back, false); +document.addEventListener('keyup', (e)=>{ + if (e.code == "Escape")back(); +}); \ No newline at end of file