mirror of
https://github.com/khairul169/honey.git
synced 2026-10-04 18:03:54 +07:00
config: Make 'open_new_tab' functional
This commit is contained in:
@@ -35,8 +35,9 @@ function safe_text(text) {
|
||||
}
|
||||
|
||||
function mk_entry(app) {
|
||||
let new_tab = get_bool("open_new_tab") ? ` target="_blank"` : "";
|
||||
return `
|
||||
<a class="box" href="${safe_text(app["href"])}">
|
||||
<a class="box" href="${safe_text(app["href"])}"${new_tab}>
|
||||
<img src="${safe_text(app["icon"])}">
|
||||
<div>
|
||||
<div class="name">${safe_text(app["name"])}</div>
|
||||
|
||||
@@ -59,6 +59,14 @@ function load_apps() {
|
||||
get("applist").innerHTML = final;
|
||||
}
|
||||
|
||||
function new_tab_toggle(setting) {
|
||||
let v = !get_bool("open_new_tab");
|
||||
config("open_new_tab", v);
|
||||
setting = setting.classList;
|
||||
v ? setting.add("checked") : setting.remove("checked");
|
||||
load_apps();
|
||||
}
|
||||
|
||||
let S_TAP_LOCK;
|
||||
function open_screen(button) {
|
||||
if (S_TAP_LOCK) return;
|
||||
|
||||
Reference in New Issue
Block a user