forked from sheepzh/time-tracker-4-browser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.ts
More file actions
21 lines (18 loc) · 661 Bytes
/
button.ts
File metadata and controls
21 lines (18 loc) · 661 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { t } from "@src/content-script/locale"
import { LINK_STYLE } from "../modal-style"
export class DelayButton {
public dom: HTMLDivElement
constructor(onClick: () => void) {
this.dom = document.createElement('p')
this.dom.style.marginTop = '100px'
// Only delay-allowed rules exist, can delay
// @since 0.4.0
const link = document.createElement('a')
Object.assign(link.style || {}, LINK_STYLE)
link.setAttribute('href', 'javascript:void(0)')
const text = t(msg => msg.more5Minutes)
link.innerText = text
link.onclick = onClick
this.dom.append(link)
}
}