mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
chore(clickblock): use native setTimeout
This commit is contained in:
@ -1,3 +1,6 @@
|
|||||||
|
import {nativeTimeout} from './dom';
|
||||||
|
|
||||||
|
|
||||||
const CSS_CLICK_BLOCK = 'click-block-active';
|
const CSS_CLICK_BLOCK = 'click-block-active';
|
||||||
const DEFAULT_EXPIRE = 330;
|
const DEFAULT_EXPIRE = 330;
|
||||||
let cbEle, fallbackTimerId;
|
let cbEle, fallbackTimerId;
|
||||||
@ -34,7 +37,7 @@ export class ClickBlock {
|
|||||||
|
|
||||||
function show(expire) {
|
function show(expire) {
|
||||||
clearTimeout(fallbackTimerId);
|
clearTimeout(fallbackTimerId);
|
||||||
fallbackTimerId = setTimeout(hide, expire || DEFAULT_EXPIRE);
|
fallbackTimerId = nativeTimeout(hide, expire || DEFAULT_EXPIRE);
|
||||||
|
|
||||||
if (!isShowing) {
|
if (!isShowing) {
|
||||||
cbEle.classList.add(CSS_CLICK_BLOCK);
|
cbEle.classList.add(CSS_CLICK_BLOCK);
|
||||||
|
Reference in New Issue
Block a user