Add foundation for being able to create embedded items without requiring going through the sidebar
This commit is contained in:
parent
4f138202ce
commit
5eedea5001
2 changed files with 24 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { deleteItemFromElement, editItemFromElement } from "./utils.mjs";
|
||||
import { createItemFromElement, deleteItemFromElement, editItemFromElement } from "./utils.mjs";
|
||||
import { DicePool } from "./DicePool.mjs";
|
||||
import { RichEditor } from "./RichEditor.mjs";
|
||||
import { toBoolean } from "../consts.mjs";
|
||||
|
|
@ -16,6 +16,10 @@ export function GenericAppMixin(HandlebarsApp) {
|
|||
],
|
||||
actions: {
|
||||
roll: this.#rollDice,
|
||||
createItem: (_event, target) => {
|
||||
const parent = this.document;
|
||||
createItemFromElement(target, { parent });
|
||||
},
|
||||
editItem: (_event, target) => editItemFromElement(target),
|
||||
deleteItem: (_event, target) => deleteItemFromElement(target),
|
||||
openRichEditor: this.#openRichEditor,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue