Skip to content
This repository was archived by the owner on Jul 25, 2025. It is now read-only.

Commit 1806a56

Browse files
committed
fix: remove warning
1 parent 8f4607b commit 1806a56

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

popup.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22
* @desc Wait until all DOM loaded then execute DOM manipulation
33
*/
44
document.addEventListener('DOMContentLoaded', function () {
5-
document.querySelector('#btn_mutter').addEventListener('click', submitToTwitter);
6-
document.querySelector("#link-more").addEventListener("click" , function () {
5+
const btnMutter = document.querySelector('#btn_mutter');
6+
const linkMore = document.querySelector('#link-more');
7+
const btnMore = document.querySelector('#btn-more');
8+
btnMutter && btnMutter.addEventListener('click', submitToTwitter);
9+
linkMore && linkMore.addEventListener("click" , function () {
710
this.style.display = "none" ;
811
document.querySelector("#more-options").style.display = "block";
912
});
10-
document.querySelector('#btn-more').addEventListener('click', categoryMutter);
13+
btnMore && btnMore.addEventListener('click', categoryMutter);
1114
});
1215

1316
/**
14-
* @name submitToTwitte
17+
* @name submitToTwitter
1518
* @desc Submit values to twitter site.
1619
*/
1720
function submitToTwitter() {

0 commit comments

Comments
 (0)