diff --git a/src/events/debugEvent.js b/src/events/debugEvent.js index a7cc04445b883b8c3e41520b4f897571ddc0c36a..d8c3dce979a1202ce3fb8a9013a95750d02aee3d 100644 --- a/src/events/debugEvent.js +++ b/src/events/debugEvent.js @@ -27,23 +27,6 @@ App.Events.debugEvent = function(eventName) { function makeActorList() { const actors = document.createDocumentFragment(); const actorReqs = event.actorPrerequisites(); - if (!displayOnlyValid) { - App.UI.DOM.appendNewElement("div", actors, App.UI.DOM.link( - "Show only valid slaves", - () => { - displayOnlyValid = true; - $('#actorList').empty().append(makeActorList()); - } - )); - } else { - App.UI.DOM.appendNewElement("div", actors, App.UI.DOM.link( - "Show all slaves", - () => { - displayOnlyValid = false; - $('#actorList').empty().append(makeActorList()); - } - )); - } if (actorReqs.length === 1) { actors.append(singleActorList(0)); @@ -59,6 +42,23 @@ App.Events.debugEvent = function(eventName) { function singleActorList(i) { let tab = App.UI.DOM.makeElement("div"); + if (!displayOnlyValid) { + App.UI.DOM.appendNewElement("div", tab, App.UI.DOM.link( + "Show only valid slaves", + () => { + displayOnlyValid = true; + $('#actorList').empty().append(makeActorList()); + } + )); + } else { + App.UI.DOM.appendNewElement("div", tab, App.UI.DOM.link( + "Show all slaves", + () => { + displayOnlyValid = false; + $('#actorList').empty().append(makeActorList()); + } + )); + } for (const slave of V.slaves) { let slaveDiv = App.UI.DOM.makeElement("div", App.UI.DOM.makeElement("span", SlaveFullName(slave), "slave-name")); let slaveFails = false;