Fixes to personal layout
This commit is contained in:
parent
9bdfd73db4
commit
9409f20bca
5 changed files with 31 additions and 11 deletions
|
@ -51,8 +51,10 @@ export class PersonalLayersPanel extends UIElement {
|
|||
continue;
|
||||
}
|
||||
let icon = layer.icon ?? "./assets/checkmark.svg";
|
||||
if (typeof (icon) !== "string") {
|
||||
icon = icon.GetContent({"id": "node/-1"}).txt ?? "./assets/checkmark.svg";
|
||||
let iconUnset = layer.icon ?? "";
|
||||
if (layer.icon !== undefined && typeof (layer.icon) !== "string") {
|
||||
icon = layer.icon.GetContent({"id": "node/-123456"}).txt ?? "./assets/checkmark.svg";
|
||||
iconUnset = icon;
|
||||
}
|
||||
|
||||
let name = layer.name ?? layer.id;
|
||||
|
@ -65,10 +67,16 @@ export class PersonalLayersPanel extends UIElement {
|
|||
"</b> ",
|
||||
layer.description !== undefined ? new Combine(["<br/>", layer.description]) : "",
|
||||
])
|
||||
|
||||
const iconImage = `<img src="${icon}">`;
|
||||
const iconUnsetImage = `<img src="${iconUnset}">`
|
||||
|
||||
const cb = new CheckBox(
|
||||
new SubtleButton(icon ?? "./assets/checkmark.svg", content),
|
||||
new SubtleButton(
|
||||
new FixedUiElement(`<img src="${icon}">`).SetStyle("opacity:0.1"),
|
||||
new FixedUiElement(iconImage).SetStyle(""),
|
||||
content),
|
||||
new SubtleButton(
|
||||
new FixedUiElement(iconUnsetImage).SetStyle("opacity:0.1;"),
|
||||
new Combine(["<del>",
|
||||
content,
|
||||
"</del>"
|
||||
|
|
|
@ -93,6 +93,7 @@ export default class Translation extends UIElement {
|
|||
const tr = {};
|
||||
for (const lng in this.translations) {
|
||||
let txt = this.translations[lng];
|
||||
console.log(txt)
|
||||
txt = txt.replace(/\..*/, "");
|
||||
txt = Utils.EllipsesAfter(txt, 255);
|
||||
tr[lng] = txt;
|
||||
|
|
|
@ -59,9 +59,11 @@
|
|||
"amenity=toilets"
|
||||
],
|
||||
"description": {
|
||||
"render": {
|
||||
"en": "A publicly accessible toilet or restroom",
|
||||
"de": "Eine öffentlich zugängliche Toilette"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"title": {
|
||||
|
|
|
@ -664,9 +664,10 @@ body {
|
|||
|
||||
.subtle-button img {
|
||||
max-width: 3em;
|
||||
max-height: 3em;
|
||||
height: 3em;
|
||||
margin-right: 0.5em;
|
||||
padding: 0.5em;
|
||||
padding: 0;
|
||||
padding-bottom:0.2em;
|
||||
}
|
||||
|
||||
|
||||
|
|
14
index.ts
14
index.ts
|
@ -7,11 +7,10 @@ import {UIEventSource} from "./Logic/UIEventSource";
|
|||
import * as $ from "jquery";
|
||||
import {FromJSON} from "./Customizations/JSON/FromJSON";
|
||||
import {TagRendering} from "./UI/TagRendering";
|
||||
import {State} from "./State";
|
||||
|
||||
TagRendering.injectFunction();
|
||||
|
||||
|
||||
let defaultLayout = "buurtnatuur"
|
||||
// --------------------- Special actions based on the parameters -----------------
|
||||
// @ts-ignore
|
||||
if (location.href.startsWith("http://buurtnatuur.be")) {
|
||||
|
@ -20,6 +19,15 @@ if (location.href.startsWith("http://buurtnatuur.be")) {
|
|||
}
|
||||
|
||||
|
||||
if (location.href.indexOf("buurtnatuur.be") >= 0) {
|
||||
defaultLayout = "buurtnatuur"
|
||||
}
|
||||
|
||||
if(location.href.indexOf("pietervdvn.github.io") >= 0){
|
||||
defaultLayout = "bookcases"
|
||||
}
|
||||
|
||||
|
||||
|
||||
let testing: UIEventSource<string>;
|
||||
if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
|
||||
|
@ -36,7 +44,7 @@ if (location.hostname === "localhost" || location.hostname === "127.0.0.1") {
|
|||
|
||||
// ----------------- SELECT THE RIGHT QUESTSET -----------------
|
||||
|
||||
let defaultLayout = "buurtnatuur"
|
||||
|
||||
|
||||
const path = window.location.pathname.split("/").slice(-1)[0];
|
||||
if (path !== "index.html" && path !== "") {
|
||||
|
|
Loading…
Reference in a new issue