From 08ab40589379b70732d97d2c002bbae8213e8086 Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Fri, 16 Aug 2024 17:02:03 +0100 Subject: [PATCH] Rename method for looking up trix attribute or action by translation key --- app/webpacker/controllers/trixeditor_controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/webpacker/controllers/trixeditor_controller.js b/app/webpacker/controllers/trixeditor_controller.js index ec9bef9b02..7c76c63310 100644 --- a/app/webpacker/controllers/trixeditor_controller.js +++ b/app/webpacker/controllers/trixeditor_controller.js @@ -63,12 +63,12 @@ export default class extends Controller { // Set toolbar translations (Chrome) this.#setTranslation( - `[data-trix-action="${this.#translationKeyToAttributeMappings(key)}"]`, + `[data-trix-action="${this.#attributeOrActionForTranslationKey(key)}"]`, "title", translation ); this.#setTranslation( - `[data-trix-attribute="${this.#translationKeyToAttributeMappings(key)}"]`, + `[data-trix-attribute="${this.#attributeOrActionForTranslationKey(key)}"]`, "title", translation ); @@ -86,7 +86,7 @@ export default class extends Controller { } } - #translationKeyToAttributeMappings(key) { + #attributeOrActionForTranslationKey(key) { let mapping = { "bullets": "bullet", "link": "href",