diff --git a/src/002-config/mousetrapConfig.js b/src/002-config/mousetrapConfig.js index 17135f873a43dacc974e17ddd0cde7d49d3b61a7..d0bc8f6dba111d63aa12ea390554a666ac2b7d7c 100644 --- a/src/002-config/mousetrapConfig.js +++ b/src/002-config/mousetrapConfig.js @@ -266,12 +266,12 @@ App.UI.Hotkeys = (function() { // add hotkeys App.UI.Hotkeys.add("endWeek", { callback: function() { - $("#story-caption #endWeekButton a.macro-link").trigger("click"); + $("#story-caption #endWeekButton").trigger("click"); }, combinations: ["enter"], uiName: "Next Week" }); App.UI.Hotkeys.add("nextLink", { callback: function() { - $("#story-caption #nextButton a.macro-link").trigger("click"); + $("#story-caption #nextButton").trigger("click"); }, combinations: ["space"], uiName: "Continue/Back" }); App.UI.Hotkeys.add("prev-slave", { diff --git a/src/gui/userButton.js b/src/gui/userButton.js index b173ef506a4cf70322e4f6fadcd605d6887aa164..f9372df68e93b9793817672c5026f94d13321d87 100644 --- a/src/gui/userButton.js +++ b/src/gui/userButton.js @@ -2,17 +2,17 @@ globalThis.userButton = function(nextButton = V.nextButton, nextLink = V.nextLin const el = new DocumentFragment(); const _Pass = passage(); let div = document.createElement("div"); + let link; div.style.fontWeight = "bold"; // We must always have a named element so we have something to refresh even if the button is hidden for a scene if (_Pass !== "End Week") { if (_Pass === "Main") { - div.id = "endWeekButton"; - div.append( - App.UI.DOM.link( - "END WEEK", - () => endWeek() - ) + link = App.UI.DOM.link( + "END WEEK", + () => endWeek() ); + link.id = "endWeekButton"; + div.append(link); div.append(" "); App.UI.DOM.appendNewElement("span", div, App.UI.Hotkeys.hotkeys("endWeek"), "hotkey"); el.append(div); @@ -20,16 +20,17 @@ globalThis.userButton = function(nextButton = V.nextButton, nextLink = V.nextLin App.UI.DOM.appendNewElement("div", el, `WARNING: Rules Assistant has rules with errors!`, "yellow"); } } else { - div.id = "nextButton"; if (nextButton !== " ") { - div.append( - App.UI.DOM.passageLink( - nextButton, - nextLink - ) + link = App.UI.DOM.passageLink( + nextButton, + nextLink ); + link.id = "nextButton"; + div.append(link); div.append(" "); App.UI.DOM.appendNewElement("span", div, App.UI.Hotkeys.hotkeys("nextLink"), "hotkey"); + } else { + div.id = "nextButton"; } el.append(div); }