forked from leftypol/leftypol
main.js: handle undefined styleName in style chooser
This commit is contained in:
parent
14272c87e9
commit
17f92344e9
1 changed files with 11 additions and 9 deletions
|
@ -216,6 +216,7 @@ function initStyleChooser() {
|
||||||
newElement.className = 'styles';
|
newElement.className = 'styles';
|
||||||
|
|
||||||
for (styleName in styles) {
|
for (styleName in styles) {
|
||||||
|
if (styleName) {
|
||||||
var style = document.createElement('a');
|
var style = document.createElement('a');
|
||||||
style.innerHTML = '[' + styleName + ']';
|
style.innerHTML = '[' + styleName + ']';
|
||||||
style.onclick = function() {
|
style.onclick = function() {
|
||||||
|
@ -227,6 +228,7 @@ function initStyleChooser() {
|
||||||
style.href = 'javascript:void(0);';
|
style.href = 'javascript:void(0);';
|
||||||
newElement.appendChild(style);
|
newElement.appendChild(style);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
document.getElementById('bottom-hud').before(newElement);
|
document.getElementById('bottom-hud').before(newElement);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue