Skip to content

Commit 4402ece

Browse files
committed
Minor style fixes
- Make selects shorter on carrier list - Make hex generator button enable or disable if the required settings are made or not
1 parent f8068f1 commit 4402ece

File tree

5 files changed

+29
-7
lines changed

5 files changed

+29
-7
lines changed

src/assets/js/device-restore.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,26 @@ $(document).ready(function() {
1515
$('#progressDiv').hide();
1616
}
1717

18+
if ($('#hexGeneratorForm').length > 0) {
19+
const buttonEnable = function() {
20+
const imageFile = $('input[name="imageFile"]:checked').val();
21+
const userBinFiles = $('#userBinFile').prop('files');
22+
if (!imageFile || !userBinFiles || userBinFiles.length != 1) {
23+
// Not valid settings
24+
$('#hexGeneratorForm').find('button').attr('disabled', 'disabled');
25+
}
26+
else {
27+
$('#hexGeneratorForm').find('button').removeAttr('disabled');
28+
}
29+
};
30+
31+
$('input').on('change', buttonEnable);
32+
33+
buttonEnable();
34+
}
1835
});
1936

37+
2038
async function startFlash(platform, version) {
2139
$('#deviceRestoreTable').hide();
2240
$('#progressDiv').hide();

src/assets/less/carriers.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,7 @@ div.sideBySide0 {
3838
div.sideBySide1 {
3939
flex: 1;
4040
}
41+
42+
select.carrierListSelect {
43+
height: 31px;
44+
}

src/content/hex-generator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This tool takes the [restore binaries](/reference/developer-tools/jtag/#restore-
2121

2222
- Select your user firmware .bin file:
2323

24-
<form>
24+
<form id="hexGeneratorForm">
2525
<p><input type="file" id="userBinFile" name="userBinFile" accept=".bin"></p>
2626
<p><button type="button" onclick="downloadHex()">Generate and Download Hex File</button></p>
2727
</form>

templates/layouts/carriers.hbs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@
7676
<table>
7777
<tr>
7878
<td class="carrierFormLabel">Device:</td>
79-
<td><select id="deviceList"></select></td>
79+
<td><select id="deviceList" class="carrierListSelect"></select></td>
8080
</tr>
8181
<tr>
8282
<td class="carrierFormLabel">Region:</td>
83-
<td><select id="regionList"></select></td>
83+
<td><select id="regionList" class="carrierListSelect"></select></td>
8484
</tr>
8585
</table>
8686
</form>
@@ -99,7 +99,7 @@
9999
<form>
100100
<div>
101101
<input type="radio" id="country2RegionRadio" name="country2Radio" value="region">
102-
<label for="country2RegionRadio">Region <select id="country2RegionSel">
102+
<label for="country2RegionRadio">Region <select id="country2RegionSel" class="carrierListSelect">
103103
</select></label>
104104

105105
<input type="radio" id="country2CountryRadio" name="country2Radio" value="country">
@@ -129,7 +129,7 @@
129129
<tr>
130130
<td class="carrierFormLabel">Device Family:</td>
131131
<td>
132-
<select id="familyMapSelect">
132+
<select id="familyMapSelect" class="carrierListSelect">
133133
<option value="tracker">Tracker</option>
134134
<option value="b series">B Series SoM</option>
135135
<option value="boron">Boron</option>
@@ -153,7 +153,7 @@
153153
<table>
154154
<tr>
155155
<td class="carrierFormLabel">Device:</td>
156-
<td><select id="countryDetailDeviceList"></select></td>
156+
<td><select id="countryDetailDeviceList" class="carrierListSelect"></select></td>
157157
</tr>
158158
<tr>
159159
<td class="carrierFormLabel">Country:</td>

templates/layouts/device-restore.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<div id="errorDiv"></div>
1717

18-
<div id="progressDiv">
18+
<div id="progressDiv" style="display:none;">
1919
<label for="progressBar">Flash progress:</label>
2020
<progress id="progressBar" value="0" max="100"></progress>
2121
</div>

0 commit comments

Comments
 (0)