Skip to content

Commit 9532849

Browse files
committed
Fix checkboxes
1 parent c9e8e9c commit 9532849

File tree

4 files changed

+50
-31
lines changed

4 files changed

+50
-31
lines changed

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "__MSG_extensionName__",
55
"description": "__MSG_extensionDescription__",
66
"author": "Andreas Bielawski",
7-
"version": "3.4.2",
7+
"version": "3.4.3",
88
"icons": {
99
"16": "icons/16.png",
1010
"32": "icons/32.png",

options/options.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ body {
1313
margin-right: 0;
1414
}
1515

16-
.custom-control-indicator {
17-
background-color: #fff;
18-
}
19-
2016
#searchProviderList > div {
2117
margin-bottom: 0.4rem;
2218
}
@@ -61,3 +57,7 @@ body {
6157
#searchProviderList .sp-url:invalid + .sp-status .text-success {
6258
display: none;
6359
}
60+
61+
.input-group-text input[type="checkbox"], .input-group-text input[type="radio"] {
62+
margin-top: revert;
63+
}

options/options.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
<label for="openInBackground" class="col-sm-3" id="openInBackgroundLabel">{{i18n.openInBackgroundLabel}}</label>
2424
<div class="col-sm-9">
2525
<label class="form-check-label custom-control custom-checkbox">
26-
<input class="form-check-input custom-control-input" type="checkbox" id="openInBackground" />
27-
<span class="custom-control-indicator"></span>
26+
<input class="form-check-input" type="checkbox" id="openInBackground" />
2827
</label>
2928
</div>
3029
</div>
@@ -34,8 +33,7 @@
3433
<label for="openAllByDefault" class="col-sm-3" id="openAllByDefaultLabel">{{i18n.openAllByDefaultLabel}}</label>
3534
<div class="col-sm-9">
3635
<label class="form-check-label custom-control custom-checkbox">
37-
<input class="form-check-input custom-control-input" type="checkbox" id="openAllByDefault" />
38-
<span class="custom-control-indicator"></span>
36+
<input class="form-check-input" type="checkbox" id="openAllByDefault" />
3937
</label>
4038
</div>
4139
</div>

options/options.js

Lines changed: 43 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,33 +54,46 @@ function validateSpUrl(url, index) {
5454
}
5555

5656
function createSpRemoveElement() {
57-
// <a class="sp-remove input-group-addon">
58-
// <i class="fa fa-trash" aria-hidden="true"></i>
57+
// <a class="sp-remove input-group-append">
58+
// <div class="input-group-text">
59+
// <i class="fa fa-trash" aria-hidden="true"></i>
60+
// </div>
5961
// </a>
6062
const a = $el('a');
61-
a.classList.add('sp-remove', 'input-group-addon');
63+
a.classList.add('sp-remove', 'input-group-append');
64+
const div = $el('div');
65+
div.classList.add('input-group-text');
66+
a.appendChild(div);
67+
6268
i = document.createElement('i');
6369
i.classList.add('fa', 'fa-trash');
6470
i.setAttribute('aria-hidden', 'true');
65-
a.appendChild(i);
71+
div.appendChild(i);
6672
return a;
6773
}
6874

6975
function createSpStatusElement() {
70-
// <a class="sp-status input-group-addon">
76+
// <a class="sp-status input-group-append">
77+
// <div class="input-group-text">
7178
// <i class="fa fa-check text-success" aria-hidden="true"></i>
7279
// <i class="fa fa-times text-danger" aria-hidden="true"></i>
80+
// </div>
7381
// </a>
7482
const a = $el('a');
7583
a.classList.add('sp-status', 'input-group-addon');
84+
const div = $el('div');
85+
div.classList.add('input-group-text');
86+
87+
a.appendChild(div);
88+
7689
i = document.createElement('i');
7790
i.classList.add('fa', 'fa-check', 'text-success');
7891
i.setAttribute('aria-hidden', 'true');
79-
a.appendChild(i);
92+
div.appendChild(i);
8093
i = document.createElement('i');
8194
i.classList.add('fa', 'fa-times', 'text-danger');
8295
i.setAttribute('aria-hidden', 'true');
83-
a.appendChild(i);
96+
div.appendChild(i);
8497
return a;
8598
}
8699

@@ -107,16 +120,22 @@ function createSpNameElement(text) {
107120
}
108121

109122
function createSpIconElement(src) {
110-
// <span class="sp-icon input-group-addon">
123+
// <span class="sp-icon input-group-prepend">
124+
// <div class="input-group-text">
111125
// <img src=""/>
126+
// </div>
112127
// </span>
113128
const span = $el('span');
114-
span.classList.add('sp-icon', 'input-group-addon');
129+
span.classList.add('sp-icon', 'input-group-prepend');
130+
131+
const div = $el('div');
132+
div.classList.add('input-group-text');
115133

116134
const iconImg = new Image();
117135
iconImg.src = chrome.extension.getURL(src);
118136

119-
span.appendChild(iconImg);
137+
div.appendChild(iconImg);
138+
span.appendChild(div);
120139

121140
const msgIconUploadNotImage = chrome.i18n.getMessage('msgIconUploadNotImage');
122141
const msgIconUploadNotSquareImage = chrome.i18n.getMessage('msgIconUploadNotSquareImage');
@@ -185,28 +204,30 @@ function createSpIconElement(src) {
185204
}
186205

187206
function createSpCheckboxElement(selected) {
188-
// <span class="sp-selected input-group-addon form-check">
189-
// <label class="form-check-label custom-control custom-checkbox">
190-
// <input class="form-check-input custom-control-input" type="checkbox" />
191-
// <span class="custom-control-indicator" />
207+
// <span class="sp-selected input-group-prepend form-check">
208+
// <div class="input-group-text">
209+
// <label class="form-check-label custom-control">
210+
// <input class="form-check-input" type="checkbox" />
192211
// </label>
212+
// </div>
193213
// </span>
194214
const span = $el('span');
195-
span.classList.add('sp-selected', 'input-group-addon', 'form-check');
215+
span.classList.add('sp-selected', 'input-group-prepend', 'form-check');
216+
217+
const div = $el('div');
218+
div.classList.add('input-group-text');
219+
220+
span.appendChild(div);
196221

197222
label = document.createElement('label');
198-
label.classList.add('form-check-label', 'custom-control', 'custom-checkbox');
199-
span.appendChild(label);
223+
label.classList.add('form-check-label', 'custom-control');
224+
div.appendChild(label);
200225

201226
input = document.createElement('input');
202-
input.classList.add('form-check-input', 'custom-control-input');
227+
input.classList.add('form-check-input');
203228
input.setAttribute('type', 'checkbox');
204229
if (selected) {input.checked = true;} else {input.checked = false;}
205230
label.appendChild(input);
206-
207-
spancci = document.createElement('span');
208-
spancci.classList.add('custom-control-indicator');
209-
label.appendChild(spancci);
210231
return span;
211232
}
212233

0 commit comments

Comments
 (0)