Skip to content

Commit 77a6426

Browse files
committed
refactor - WIP
1 parent ea3cd36 commit 77a6426

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

popup/index.js

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -334,18 +334,16 @@ function createScriptButton(script, isFavorite = false) {
334334
video.muted = true;
335335
video.loop = true;
336336
video.style.width = "80vw";
337-
video.addEventListener("loadeddata", () => {
338-
video.pause();
339-
video.currentTime = 0;
340-
video.play();
337+
// TODO why this not working??
338+
button.addEventListener("mouseenter", () => {
339+
setTimeout(() => {
340+
video.pause();
341+
video.currentTime = 0;
342+
video.play();
343+
}, 10);
341344
});
342-
tooltip.addEventListener("mouseenter", () => {
343-
video.pause();
344-
video.currentTime = 0;
345-
video.play();
346-
});
347-
tooltip.addEventListener("mouseleave", () => {
348-
video.pause();
345+
button.addEventListener("mouseleave", () => {
346+
setTimeout(() => video.pause(), 0);
349347
});
350348
tooltip.appendChild(video);
351349
}

scripts/web_timer_main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ chrome.storage.local.get("web_timer", function (result) {
3636

3737
// if (!web_timer || !Object.keys(web_timer).length) {
3838
guide.innerHTML = t({
39-
vi: "Không có dữ liệu<br/>Vui lòng bật chức năng<br/>Sau đó tải lại các trang web để bắt đầu quá trình đếm.",
40-
en: "No data<br/>Please enable this script<br/>Then reload all your websites to start the timer.",
39+
vi: "Không có dữ liệu",
40+
en: "No data",
4141
});
4242
// }
4343

0 commit comments

Comments
 (0)