Open Rorrenoa opened 2 weeks ago
It seems that the Handlebars Helper from Foundry for the editor
itself unfortunately does not allow you to define multiple CSS classes.
I have now overwritten them with my own. That seems to work. Although I don't know if that is the best way to do it.
Maybe it will help.
Handlebars.registerHelper("editor", function(content, options) {
const { target, editable=true, button, engine="tinymce", collaborate=false, class: cssClass } = options.hash;
const config = {name: target, value: content, button, collaborate, editable, engine};
const element = foundry.applications.fields.createEditorInput(config);
if ( cssClass ) {
const classList = cssClass.split(" ");
element.querySelector(".editor-content").classList.add(...classList);
return new Handlebars.SafeString(element.outerHTML);
}
});
Cheers
Hi, I just noticed that there is an error with some item classes.![error](https://github.com/JackPyro/daggerheart/assets/12672232/3a6102a4-c670-4338-adff-5f779374909b)
I suspect that this is because in the handlebars which call![handlebars](https://github.com/JackPyro/daggerheart/assets/12672232/cda85864-2acf-46c3-9714-1f65fd69f5bd)
{{editor}}
a class element is created which is separated by spaces. For example initem-card-sheet.hbs
Unfortunately I don't know enough about handlebars, but this probably affects the following files.
leveling.hbs
stats.hbs
item-domain-sheet.hbs
item-item-sheet.hbs
item-weapon-sheet.hbs
item-card-sheet.hbs
I tested the whole thing on v12 with the outstanding v12 PR. Maybe it will help you. Cheers