diff --git a/src/ui/ab.js b/src/ui/ab.js index 73ca30ae5..6b6aa0ca7 100644 --- a/src/ui/ab.js +++ b/src/ui/ab.js @@ -1,5 +1,5 @@ -import { handler, string2RGB, platformSvg, msgbox } from "./common.js"; -import { app, formatId, createNewConnect } from "./index.js"; // TODO check app obj +import { handler, string2RGB, platformSvg, msgbox,translate } from "./common.js"; +import { app, formatId, createNewConnect,svg_menu } from "./index.js"; // TODO check app obj // TODO transform const svg_tile = ; const svg_list = ; @@ -11,16 +11,27 @@ function getSessionsStyleOption(type) { } export function getSessionsStyle(type) { - var v = handler.get_local_option(getSessionsStyleOption(type)); + var v = handler.xcall("get_local_option",getSessionsStyleOption(type)); if (!v) v = type == "ab" ? "list" : "tile"; return v; } -class SearchBar extends Element { +// Fixed +// function stupidUpdate(me) { +// /* hidden is workaround of stupid sciter bug */ +// me.hidden = true; +// me.update(); +// self.timer(60ms, function() { +// me.hidden = false; +// me.update(); +// }); +// } + +export class SearchBar extends Element { parent; value = ""; - constructor(props) { + this(props) { this.parent = props.parent; } @@ -50,10 +61,10 @@ class SearchBar extends Element { } } -class SessionStyle extends Element { +export class SessionStyle extends Element { type = ""; - constructor(props) { + this(props) { this.type = (props || {}).type; } @@ -74,13 +85,13 @@ class SessionStyle extends Element { } } -class SessionList extends Element { +export class SessionList extends Element { sessions = []; type = ""; style; filterPattern = ""; - constructor(props) { + this(props) { this.sessions = props.sessions; this.type = props.type; this.style = getSessionsStyle(props.type); @@ -104,7 +115,7 @@ class SessionList extends Element { render() { let sessions = this.getSessions(); - if (sessions.length == 0) return ; + if (!sessions || sessions.length == 0) return ; // TODO property 'length' of undefined sessions = sessions.map((x) => this.getSession(x)); // TODO is_win return