@@ -569,15 +569,14 @@ var ts = (function (exports, $) {
569
569
}
570
570
compile ( ) {
571
571
compile_template ( this , `
572
- <div class="modal ${ this . css } " id="${ this . uid } " t-elem="elem">
572
+ <div class="modal fade ${ this . css } " id="${ this . uid } " t-elem="elem" data-bs-backdrop="static ">
573
573
<div class="modal-dialog">
574
574
<div class="modal-content">
575
575
<div class="modal-header">
576
- <button class="btn p-0 text-primary text-decoration-underline link-offset-2 close" t-prop="close_btn" t-bind-click="close">
577
- <span aria-hidden="true">×</span>
578
- <span class="sr-only">Close</span>
579
- </button>
580
576
<h5 class="modal-title">${ this . title } </h5>
577
+ <button class="btn-close close" t-prop="close_btn" t-bind-click="close">
578
+ <span class="visually-hidden">Close</span>
579
+ </button>
581
580
</div>
582
581
<div class="modal-body" t-elem="body">${ this . content } </div>
583
582
<div class="modal-footer" t-elem="footer"></div>
@@ -587,22 +586,18 @@ var ts = (function (exports, $) {
587
586
` ) ;
588
587
}
589
588
open ( ) {
590
- $ ( 'body' )
591
- . css ( 'padding-right' , '13px' )
592
- . css ( 'overflow-x' , 'hidden' )
593
- . addClass ( 'modal-open' ) ;
589
+ $ ( 'body' ) . addClass ( 'modal-open' ) ;
594
590
this . container . append ( this . elem ) ;
595
591
this . elem . show ( ) ;
592
+ this . elem . modal ( 'show' ) ;
596
593
this . is_open = true ;
597
594
this . trigger ( 'on_open' ) ;
598
595
}
599
596
close ( ) {
600
597
if ( $ ( '.modal:visible' ) . length === 1 ) {
601
- $ ( 'body' )
602
- . css ( 'padding-right' , '' )
603
- . css ( 'overflow-x' , 'auto' )
604
- . removeClass ( 'modal-open' ) ;
598
+ $ ( 'body' ) . removeClass ( 'modal-open' ) ;
605
599
}
600
+ this . elem . modal ( 'hide' ) ;
606
601
this . elem . remove ( ) ;
607
602
this . is_open = false ;
608
603
this . trigger ( 'on_close' ) ;
0 commit comments