File tree Expand file tree Collapse file tree 1 file changed +4
-15
lines changed
src/BootstrapBlazor/Components/Button Expand file tree Collapse file tree 1 file changed +4
-15
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,9 @@ export function init(id) {
1616 EventHandler . on ( button , 'click' , ( ) => {
1717 toggle ( el , list )
1818 } )
19-
20- const module = registerBootstrapBlazorModule ( 'DialButton' , {
21- hooked : false ,
22- items : [ ] ,
23- registerClosePopupHandler : function ( ) {
24- if ( this . hooked === false ) {
25- this . hooked = true ;
26- EventHandler . on ( document , 'click' , closePopup ) ;
27- }
28- }
19+ registerBootstrapBlazorModule ( 'DialButton' , id , ( ) => {
20+ EventHandler . on ( document , 'click' , closePopup ) ;
2921 } ) ;
30- module . registerClosePopupHandler ( ) ;
31- module . items . push ( id ) ;
3222}
3323
3424export function update ( id ) {
@@ -56,10 +46,9 @@ export function dispose(id) {
5646 }
5747
5848 const { DialButton } = window . BootstrapBlazor ;
59- DialButton . items . pop ( id )
60- if ( DialButton . items . length === 0 ) {
49+ DialButton . dispose ( id , ( ) => {
6150 EventHandler . off ( document , 'click' , closePopup )
62- }
51+ } ) ;
6352}
6453
6554const toggle = ( el , list ) => {
You can’t perform that action at this time.
0 commit comments