添加自动隐藏光标

This commit is contained in:
Harvey Zack committed 2018-11-05 15:35:09 +08:00
1 parent 617fd9681e
commit d9fd20bdf3
14 files changed
+127 -27

No files matched your search

+14
View File
@@ -115,3 +115,17 @@ export function sleep(ms = 0) {
export function sublings(target) {
return Array.from(target.parentElement.children).filter(item => item !== target);
}
export function debounce(func, wait, scope) {
let timeout;
return function fn() {
const context = scope || this;
const args = arguments;
const later = function later() {
timeout = null;
func.apply(context, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
}