@@ -14,19 +14,19 @@ import { PresetConfig } from './editApp.js';
1414export async function registerPresetHandlebarPartials ( ) {
1515 await foundry . applications . handlebars . getTemplate (
1616 `modules/${ MODULE_ID } /templates/preset/container/partials/preset.hbs` ,
17- 'me-preset'
17+ 'me-preset' ,
1818 ) ;
1919 await foundry . applications . handlebars . getTemplate (
2020 `modules/${ MODULE_ID } /templates/preset/container/partials/folder.hbs` ,
21- 'me-preset-folder'
21+ 'me-preset-folder' ,
2222 ) ;
2323 await foundry . applications . handlebars . getTemplate (
2424 `modules/${ MODULE_ID } /templates/preset/container/partials/presetsContent.hbs` ,
25- 'me-presets-content'
25+ 'me-presets-content' ,
2626 ) ;
2727 await foundry . applications . handlebars . getTemplate (
2828 `modules/${ MODULE_ID } /templates/preset/container/partials/presetsTopList.hbs` ,
29- 'me-preset-list'
29+ 'me-preset-list' ,
3030 ) ;
3131
3232 // Conditional rendering helper
@@ -55,7 +55,7 @@ export async function registerPresetHandlebarPartials() {
5555}
5656
5757export class PresetContainerV2 extends foundry . applications . api . HandlebarsApplicationMixin (
58- foundry . applications . api . ApplicationV2
58+ foundry . applications . api . ApplicationV2 ,
5959) {
6060 static _oldPositions = { } ;
6161
@@ -722,6 +722,10 @@ export class PresetContainerV2 extends foundry.applications.api.HandlebarsApplic
722722 return p ;
723723 } ) ;
724724
725+ for ( const p of presets ) {
726+ if ( p . virtual ) await p . load ( { force : true } ) ;
727+ }
728+
725729 await PresetStorage . createDocuments ( presets , pack ) ;
726730
727731 if ( selected . length ) this . render ( true ) ;
@@ -870,7 +874,7 @@ export class PresetContainerV2 extends foundry.applications.api.HandlebarsApplic
870874 `<video width="${ 320 * ratio } " height="${ 240 * ratio } " autoplay loop><source src="${ src } " type="video/${ src
871875 . split ( '.' )
872876 . pop ( )
873- . toLowerCase ( ) } "></video>`
877+ . toLowerCase ( ) } "></video>`,
874878 ) ;
875879 }
876880 }
@@ -912,7 +916,7 @@ export class PresetContainerV2 extends foundry.applications.api.HandlebarsApplic
912916 ) ,
913917 draggable : folder . pack === PresetStorage . workingPack ,
914918 browser : true ,
915- }
919+ } ,
916920 ) ;
917921 folderElement . replaceWith ( content ) ;
918922 }
@@ -941,7 +945,7 @@ export class PresetContainerV2 extends foundry.applications.api.HandlebarsApplic
941945 createEnabled,
942946 externalTrees,
943947 browser,
944- }
948+ } ,
945949 ) ;
946950 $ ( this . form ) . find ( '.item-list' ) . html ( content ) ;
947951 }
@@ -953,7 +957,7 @@ export class PresetContainerV2 extends foundry.applications.api.HandlebarsApplic
953957 label : item . attributes . name ,
954958 type : 'uuid' ,
955959 id : item . dataset . uuid ,
956- } )
960+ } ) ,
957961 ) ;
958962 }
959963
0 commit comments