diff --git a/src/gui/Encyclopedia/encyclopediaRAActivationEditor.js b/src/gui/Encyclopedia/encyclopediaRAActivationEditor.js index 78e8cad4665e1c0bef587fb92d2cd60f2d9d01b3..5fa62bc7cac8f4e6b6381f63d5ccd45a69fa8c02 100644 --- a/src/gui/Encyclopedia/encyclopediaRAActivationEditor.js +++ b/src/gui/Encyclopedia/encyclopediaRAActivationEditor.js @@ -131,7 +131,7 @@ App.Encyclopedia.addArticle("RA Condition Editor", function() { "the condition evaluation will fail!"); acc.toParagraph(); acc.push("For example to get the slave name you can use"); - acc.push(App.UI.DOM.makeElement("span", "context => slave.slaveName", ["monospace"])); + acc.push(App.UI.DOM.makeElement("span", "context => context.slave.slaveName", ["monospace"])); acc.push("and set the getter type to string."); acc.toParagraph(); acc.push("Documentation for slave attributes can be found " + diff --git a/src/js/SpacedTextAccumulator.js b/src/js/SpacedTextAccumulator.js index c86bd406dea1d3fd3f4f8684722ad18d7a58bb37..d24ab68d2b5e628e0e689496f02d44be5259c0b5 100644 --- a/src/js/SpacedTextAccumulator.js +++ b/src/js/SpacedTextAccumulator.js @@ -1,8 +1,11 @@ -/** @template {HTMLElement|DocumentFragment} [ContainerT=DocumentFragment] */ +/** + * @typedef {HTMLElement|DocumentFragment} ContainerT + */ globalThis.SpacedTextAccumulator = class SpacedTextAccumulator { /** @param {ContainerT} [container] */ constructor(container) { - this._container = container || /** @type {ContainerT} */(new DocumentFragment()); + /** @type {ContainerT} */ + this._container = container || new DocumentFragment(); /** @type {(string|HTMLElement|DocumentFragment)[]} */ this._accumulator = []; this._checked = false; @@ -23,7 +26,6 @@ globalThis.SpacedTextAccumulator = class SpacedTextAccumulator { } } - /** get a reference the underlying container */ container() { this._checkScope(); return this._container; @@ -55,7 +57,7 @@ globalThis.SpacedTextAccumulator = class SpacedTextAccumulator { /** assemble an element from the accumulated sentences or sentence fragments, separated by spaces * @template {keyof HTMLElementTagNameMap} K * @param {K} element - * @param {string|Array<string>} [classNames] + * @param {Array<string>} [classNames] */ toNode(element, classNames) { const el = App.UI.DOM.makeElement(element, null, classNames);