Skip to content

Commit a147d76

Browse files
committed
Fixes styling issues
Signed-off-by: Daniel Kastl <[email protected]>
1 parent 103f429 commit a147d76

File tree

3 files changed

+25
-22
lines changed

3 files changed

+25
-22
lines changed

src/components/gtt-setting.ts

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,17 @@ export const gtt_setting = ():void => {
1515
switch (style) {
1616
case 'material-icons':
1717
$('<i>', {
18-
class: "ui-icons " + style,
18+
class: 'ui-icons ' + style,
1919
title: item.label,
2020
text: item.value
2121
}).prependTo(wrapper)
2222
break;
2323

2424
default:
2525
$('<i>', {
26-
class: "ui-icons icon-" + item.value,
27-
title: item.label
26+
class: 'ui-icons ' + style + ' icon-' + item.value,
27+
title: item.label,
28+
text: ''
2829
}).prependTo(wrapper)
2930
break;
3031
}
@@ -41,7 +42,7 @@ export const gtt_setting = ():void => {
4142
}
4243
for (let font in FontSymbol.prototype.defs.fonts) {
4344
const optgroup = document.createElement('optgroup')
44-
optgroup.label = font
45+
optgroup.label = FontSymbol.prototype.defs.fonts[font].name
4546
for (let i in glyph) {
4647
if (glyph[i].font == font) {
4748
const selected = selectedValue === i
@@ -59,7 +60,8 @@ export const gtt_setting = ():void => {
5960
break;
6061

6162
default:
62-
element.nextElementSibling.className = "icon-" + i
63+
element.nextElementSibling.className = style + ' icon-' + i
64+
element.nextElementSibling.textContent = ''
6365
break;
6466
}
6567
}
@@ -80,7 +82,8 @@ export const gtt_setting = ():void => {
8082
break;
8183

8284
default:
83-
document.querySelector(`#icon_${element.id}`).className = 'icon-' + data.item.value
85+
document.querySelector(`#icon_${element.id}`).className = style + ' icon-' + data.item.value
86+
document.querySelector(`#icon_${element.id}`).textContent = ''
8487
break;
8588
}
8689
}
@@ -89,13 +92,4 @@ export const gtt_setting = ():void => {
8992
.addClass('select-overflow')
9093
.addClass('ui-menu-icons customicons')
9194
})
92-
93-
// document.querySelectorAll("[id^='settings_tracker_']").forEach((element: HTMLSelectElement) => {
94-
// element.addEventListener('change', (ev) => {
95-
// const currentTarget = ev.currentTarget as HTMLSelectElement
96-
// const trackerId = currentTarget.id
97-
// document.querySelector(`#icon_${trackerId}`).className = "material-icons"
98-
// document.querySelector(`#icon_${trackerId}`).textContent = currentTarget.value
99-
// })
100-
// })
10195
}

src/stylesheets/CustomIconsDef.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import ol_style_FontSymbol from 'ol-ext/style/FontSymbol'
22

33
ol_style_FontSymbol.addDefs(
4-
{ "font":"Custom Icons",
4+
{ "font":"custom-icons",
55
"name":"Custom Icons",
66
"copyright":"Apache-2.0",
77
"prefix": "gtt"
88
},
99
{ "lobsta": "\uf101",
10-
"park-bench": "\uf102",
10+
"park_bench": "\uf102",
1111
"road": "\uf103",
1212
"waste": "\uf104"
1313
});

src/stylesheets/custom-icons.css

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
src: url("./custom-icons.woff2") format("woff2");
77
}
88

9-
i[class^="icon-"]:before, i[class*=" icon-"]:before {
10-
font-family: custom-icons !important;
9+
.custom-icons {
10+
font-weight: normal;
1111
font-style: normal;
12-
font-weight: normal !important;
13-
font-variant: normal;
1412
font-size: 24px;
1513
line-height: 1;
1614
letter-spacing: normal;
@@ -25,10 +23,21 @@ i[class^="icon-"]:before, i[class*=" icon-"]:before {
2523
font-feature-settings: "liga";
2624
}
2725

26+
i[class^="icon-"]:before, i[class*=" icon-"]:before {
27+
font-family: custom-icons !important;
28+
font-style: normal;
29+
font-weight: normal !important;
30+
font-variant: normal;
31+
text-transform: none;
32+
line-height: 1;
33+
-webkit-font-smoothing: antialiased;
34+
-moz-osx-font-smoothing: grayscale;
35+
}
36+
2837
.icon-lobsta:before {
2938
content: "\f101";
3039
}
31-
.icon-park-bench:before {
40+
.icon-park_bench:before {
3241
content: "\f102";
3342
}
3443
.icon-road:before {

0 commit comments

Comments
 (0)