File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/addons/addons/editor-animations Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -428,6 +428,38 @@ export default async function({ addon }) {
428
428
ogInitButton . call ( this , ...args ) ;
429
429
queueMicrotask ( ( ) => compileClasses ( ) ) ;
430
430
}
431
+
432
+ /* addon modal API */
433
+ const ogAddonPrompt = addon . tab . prompt ;
434
+ addon . tab . prompt = function ( ...args ) {
435
+ const modal = ogAddonPrompt . call ( this , ...args ) ;
436
+ handleOpenAnimation ( "modal" ) ;
437
+ attachCloseHijack ( "modal" ) ;
438
+ return modal ;
439
+ }
440
+ const ogAddonConfirm = addon . tab . confirm ;
441
+ addon . tab . confirm = function ( ...args ) {
442
+ const modal = ogAddonConfirm . call ( this , ...args ) ;
443
+ handleOpenAnimation ( "modal" ) ;
444
+ attachCloseHijack ( "modal" ) ;
445
+ return modal ;
446
+ }
447
+ const ogAddonCreateModal = addon . tab . createModal ;
448
+ addon . tab . createModal = function ( ...args ) {
449
+ const modal = ogAddonCreateModal . call ( this , ...args ) ;
450
+ handleOpenAnimation ( "modal" ) ;
451
+ attachCloseHijack ( "modal" ) ;
452
+ return modal ;
453
+ }
454
+ }
455
+
456
+ confirm ( ...args ) {
457
+ return modal . confirm ( this , ...args ) ;
458
+ }
459
+
460
+ prompt ( ...args ) {
461
+ return modal . prompt ( this , ...args ) ;
462
+ }
431
463
} ) ;
432
464
}
433
465
You can’t perform that action at this time.
0 commit comments