File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
src/BootstrapBlazor/Components/Popover Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,45 @@ export function init(id, options) {
99 }
1010}
1111
12+ export function show ( id , delay ) {
13+ const el = document . getElementById ( id )
14+ if ( el ) {
15+ const pop = bootstrap . Popover . getInstance ( el ) ;
16+ if ( pop ) {
17+ const handler = setTimeout ( ( ) => {
18+ clearTimeout ( handler ) ;
19+ pop . show ( ) ;
20+ } , delay || 0 ) ;
21+ }
22+ }
23+ }
24+
25+ export function hide ( id , delay ) {
26+ const el = document . getElementById ( id )
27+ if ( el ) {
28+ const pop = bootstrap . Popover . getInstance ( el ) ;
29+ if ( pop ) {
30+ const handler = setTimeout ( ( ) => {
31+ clearTimeout ( handler ) ;
32+ pop . hide ( ) ;
33+ } , delay || 0 ) ;
34+ }
35+ }
36+ }
37+
38+ export function toggle ( id , delay ) {
39+ const el = document . getElementById ( id )
40+ if ( el ) {
41+ const pop = bootstrap . Popover . getInstance ( el ) ;
42+ if ( pop ) {
43+ const handler = setTimeout ( ( ) => {
44+ clearTimeout ( handler ) ;
45+ pop . toggle ( ) ;
46+ } , delay || 0 ) ;
47+ }
48+ }
49+ }
50+
1251export function dispose ( id ) {
1352 const el = document . getElementById ( id )
1453 if ( el ) {
You can’t perform that action at this time.
0 commit comments