Skip to content

Commit 05bffd9

Browse files
committed
upd
1 parent 92e8e08 commit 05bffd9

File tree

8 files changed

+14
-10
lines changed

8 files changed

+14
-10
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
web/node_modules
22
web/package-lock.json
3-
web/dist
3+
web/dist
4+
discoverer/node_modules
5+
discoverer/package-lock.json
6+
discoverer/dist

web/src/script/bson.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default function decodeBson(b, codes = []) {
124124

125125
try {
126126
let obj = JSON.parse(s);
127-
makeBins(obj);
127+
if (bins.length) makeBins(obj);
128128
return obj;
129129
} catch (e) {
130130
throw new Error("JSON error")

web/src/script/settings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export default class Settings {
108108
events: {
109109
click: () => {
110110
document.body.classList.toggle('theme_dark');
111-
localStorage.setItem('dark', Number(document.body.classList.contains('theme_dark')));
111+
localStorage.setItem('dark', document.body.classList.contains('theme_dark') ? 1 : 0);
112112
},
113113
}
114114
}

web/src/script/widgets/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export default class InputWidget extends WidgetBase {
2828
}
2929

3030
update(value) {
31-
this.text = value ? value.toString() : '';
31+
this.text = (value ?? '') + '';
3232
let disp = '...';
3333
if (this.text.length) {
3434
let lines = this.text.split('\n');

web/src/script/widgets/label.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ export default class LabelWidget extends WidgetBase {
1919
}
2020

2121
update(value) {
22-
this.$out.innerText = value ?? '';
22+
this.$out.innerText = (value ?? '') + '';
2323
}
2424
}

web/src/script/widgets/select.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
.option {
2020
font-size: 19px;
2121
padding: 6px 8px;
22+
min-height: 23px;
2223
}
2324

2425
.option:hover {

web/src/script/widgets/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export default class SelectWidget extends WidgetBase {
7777
}
7878

7979
update(value) {
80-
this.value = value ?? 0;
80+
this.value = (value ?? 0) + '';
8181
this.$label.textContent = this.options[this.value];
8282
}
8383
}

web/src/script/widgets/slider.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ export default class SliderWidget extends WidgetBase {
2121
type: 'range',
2222
class: 'slider',
2323
var: 'slider',
24-
min: data.min ?? 0,
25-
max: data.max ?? 100,
26-
step: data.step ?? 1,
24+
min: (data.min ?? 0) + '',
25+
max: (data.max ?? 100) +'',
26+
step: (data.step ?? 1) + '',
2727
events: {
2828
input: () => this.move(),
2929
change: () => this.sendEvent(this.$slider.value),
@@ -42,7 +42,7 @@ export default class SliderWidget extends WidgetBase {
4242
}
4343

4444
update(value) {
45-
this.$slider.value = value ?? 0;
45+
this.$slider.value = (value ?? 0) + '';
4646
this.move();
4747
}
4848
}

0 commit comments

Comments
 (0)