diff options
| -rw-r--r-- | emcc.c | 17 | ||||
| -rw-r--r-- | emcclib.js | 10 |
2 files changed, 18 insertions, 9 deletions
@@ -974,14 +974,17 @@ int main(int argc, char **argv) if (thegame.can_configure) js_add_preset(0, "Custom", -1); - have_presets_dropdown = true; + have_presets_dropdown = npresets > 0 || thegame.can_configure; - /* - * Now ensure the appropriate element of the presets menu - * starts off selected, in case it isn't the first one in the - * list (e.g. Slant). - */ - select_appropriate_preset(); + if (have_presets_dropdown) + /* + * Now ensure the appropriate element of the presets menu + * starts off selected, in case it isn't the first one in the + * list (e.g. Slant). + */ + select_appropriate_preset(); + else + js_remove_type_dropdown(); } /* @@ -45,7 +45,9 @@ mergeInto(LibraryManager.library, { * provides neither presets nor configurability. */ js_remove_type_dropdown: function() { - gametypelist.style.display = "none"; + var gametypeitem = gametypelist.closest("li"); + if (gametypeitem === null) return; + gametypeitem.parentNode.removeChild(gametypeitem); }, /* @@ -55,7 +57,11 @@ mergeInto(LibraryManager.library, { * time if the game doesn't support an in-game solve function. */ js_remove_solve_button: function() { - document.getElementById("solve").style.display = "none"; + var solvebutton = document.getElementById("solve"); + if (solvebutton === null) return; + var solveitem = solvebutton.closest("li"); + if (solveitem === null) return; + solveitem.parentNode.removeChild(solveitem); }, /* |