File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -41,10 +41,25 @@ const { t } = useI18n({
4141 useScope: ' local' ,
4242});
4343
44+ const POPOVER_TIMEOUT = 10000 ; // 10 seconds
4445const popoverRef = ref ();
45- function togglePopover(event : Event ) {
46+ const popoverTimeout = ref <ReturnType <typeof setTimeout > | null >(null );
47+ function togglePopover(event : MouseEvent ) {
48+ if (! popoverRef .value ) return ;
49+
4650 popoverRef .value .toggle (event );
51+
52+ if (popoverTimeout .value ) {
53+ clearTimeout (popoverTimeout .value );
54+ popoverTimeout .value = null ;
55+ }
56+
57+ popoverTimeout .value = setTimeout (() => {
58+ popoverRef .value ?.hide ();
59+ popoverTimeout .value = null ;
60+ }, POPOVER_TIMEOUT );
4761}
62+
4863const MIN_PROGRESS_FOR_ESTIMATION = 0.05 ; // wait 5% progress for estimation
4964const MIN_ELAPSED_FOR_ESTIMATION = 5 * 1000 ; // wait 5 seconds for estimation
5065const SUFFICIENT_ITEMS_FOR_ESTIMATION = 100 ; // estimate right away if >=100 items treated
You can’t perform that action at this time.
0 commit comments