Skip to content

Commit e5436bd

Browse files
committed
Fixes build issues with minification
Minification removes type="text" from inputs Adapts css/js to account for it
1 parent c34ed2d commit e5436bd

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

src/ui/scss/main.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ button {
113113
margin: 0;
114114
}
115115

116-
input[type="checkbox"] {
116+
input[type=checkbox] {
117117
background: none;
118118
border: none;
119119
cursor: pointer;
@@ -132,7 +132,8 @@ input[type="checkbox"] {
132132
}
133133
}
134134

135-
input[type="text"] {
135+
input[type=text],
136+
input:not([type]) {
136137
background: none;
137138
border: 1px solid var(--color);
138139
color: var(--color);
@@ -828,7 +829,7 @@ ul {
828829
margin-bottom: 0.75em;
829830
position: relative;
830831

831-
& input[type="checkbox"] {
832+
& input[type=checkbox] {
832833
flex: 16px 0 0;
833834
height: 16px;
834835
margin: 0 0.75em 0 0;

src/ui/shared/app-base.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ export abstract class App {
4545
protected initialize() {
4646
this.log(`${this._appName}.initializeState`);
4747

48-
for (const el of document.querySelectorAll<HTMLInputElement>('input[type="checkbox"].setting')) {
48+
for (const el of document.querySelectorAll<HTMLInputElement>('input[type=checkbox].setting')) {
4949
const checked = el.dataset.type === 'array'
5050
? (getSettingValue<string[]>(el.name) || []).includes(el.value)
5151
: getSettingValue<boolean>(el.name) || false;
5252
el.checked = checked;
5353
}
5454

55-
for (const el of document.querySelectorAll<HTMLInputElement>('input[type="text"].setting')) {
55+
for (const el of document.querySelectorAll<HTMLInputElement>('input[type=text].setting, input:not([type]).setting')) {
5656
el.value = getSettingValue<string>(el.name) || '';
5757
}
5858

@@ -71,13 +71,13 @@ export abstract class App {
7171

7272
protected bind() {
7373
const onInputChecked = this.onInputChecked.bind(this);
74-
DOM.listenAll('input[type="checkbox"].setting', 'change', function(this: HTMLInputElement) { return onInputChecked(this, ...arguments); });
74+
DOM.listenAll('input[type=checkbox].setting', 'change', function(this: HTMLInputElement) { return onInputChecked(this, ...arguments); });
7575

7676
const onInputBlurred = this.onInputBlurred.bind(this);
77-
DOM.listenAll('input[type="text"].setting', 'blur', function(this: HTMLInputElement) { return onInputBlurred(this, ...arguments); });
77+
DOM.listenAll('input[type=text].setting, input:not([type]).setting', 'blur', function(this: HTMLInputElement) { return onInputBlurred(this, ...arguments); });
7878

7979
const onInputFocused = this.onInputFocused.bind(this);
80-
DOM.listenAll('input[type="text"].setting', 'focus', function(this: HTMLInputElement) { return onInputFocused(this, ...arguments); });
80+
DOM.listenAll('input[type=text].setting, input:not([type]).setting', 'focus', function(this: HTMLInputElement) { return onInputFocused(this, ...arguments); });
8181

8282
const onInputSelected = this.onInputSelected.bind(this);
8383
DOM.listenAll('select.setting', 'change', function(this: HTMLInputElement) { return onInputSelected(this, ...arguments); });
@@ -181,7 +181,7 @@ export abstract class App {
181181
const setting = element.closest('.settings-group__setting');
182182
if (setting == null) return;
183183

184-
const input = setting.querySelector<HTMLInputElement>('input[type="text"]');
184+
const input = setting.querySelector<HTMLInputElement>('input[type=text], input:not([type])');
185185
if (input == null) return;
186186

187187
input.value += `\${${element.dataset.token}}`;

0 commit comments

Comments
 (0)