Skip to content

Commit 5f4aed5

Browse files
committed
fix display of empty mcufamily in Processor family list
1 parent bc683fe commit 5f4aed5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

assets/javascript/downloads.js

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -189,17 +189,19 @@ function setupMcufamilies(downloads) {
189189
});
190190

191191
mcufamilies.forEach(function(mcufamily) {
192-
var li = document.createElement("li");
193-
var checkbox = document.createElement('input');
194-
checkbox.type = "checkbox";
195-
checkbox.name = "mcufamily";
196-
checkbox.className = 'filter-checkbox';
197-
checkbox.value = mcufamily;
198-
199-
li.appendChild(checkbox);
200-
li.appendChild(document.createTextNode(mcufamily));
201-
202-
mcufamilyList.appendChild(li);
192+
if (mcufamily.length) {
193+
var li = document.createElement("li");
194+
var checkbox = document.createElement('input');
195+
checkbox.type = "checkbox";
196+
checkbox.name = "mcufamily";
197+
checkbox.className = 'filter-checkbox';
198+
checkbox.value = mcufamily;
199+
200+
li.appendChild(checkbox);
201+
li.appendChild(document.createTextNode(mcufamily));
202+
203+
mcufamilyList.appendChild(li);
204+
}
203205
});
204206
}
205207

0 commit comments

Comments
 (0)