Merge branch 'master' into 065-simplify-localization

This commit is contained in:
Gesina Schwalbe 2021-01-26 20:51:45 +01:00
commit f7575da47a
10 changed files with 67 additions and 38 deletions

View file

@ -103,3 +103,21 @@ Hooks.once("setup", function () {
Hooks.once("ready", function () {
migration.migrate();
});
/**
* Select the text of input elements in given sheets via onfocus listener.
* The hook names are of the form "render"+sheet_superclassname and are called within
* the render() method of the foundry Application class.
* Note: The render hooks of all classes in the class hierarchy are called,
* so e.g. for a Dialog, both "renderDialog" and "renderApplication" are called
* (in this order).
*/
["renderApplication", "renderActorSheet", "renderItemSheet"].forEach((hookName: string) => {
Hooks.on(hookName, (app: Dialog, html: JQueryStatic, data: any) => {
$(html)
.find("input")
.on("focus", (ev: JQuery.FocusEvent<HTMLInputElement>) => {
ev.currentTarget.select();
});
});
});