Skip to content

Commit

Permalink
moved click event from html to js
Browse files Browse the repository at this point in the history
  • Loading branch information
0APOCALYPSE0 committed Oct 5, 2023
1 parent 3604295 commit f50067f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
<div class="card-title h5">Shorto - URL Shorter</div> </div>
<div class="container">
<iframe src="https://ghbtns.com/github-btn.html?user=vinyashegde&repo=shorto_url_shorter&type=star&count=true" frameborder="0" scrolling="0" width="120" height="20" title="GitHub" id="github-icon"></iframe>
<img src="off-button.png" width="32" height="32" onClick="toggleViewCount()" style="cursor: pointer;"/>
<img src="off-button.png" id="toggleBtn" width="32" height="32" style="cursor: pointer;"/>
</div>

<div class="card-body">
Expand Down
4 changes: 4 additions & 0 deletions Source/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const copyQr = document.getElementById("copyQr")
const downloadQr = document.getElementById("downloadQr")
const sharer = document.getElementById("share")
var qrcode = new QRCode(codeDiv);
const toggleBtn = document.querySelector("#toggleBtn");
let viewCountEnabled = false;


Expand Down Expand Up @@ -172,6 +173,7 @@ const validateExpiryCount = (expiryCount) => {
}
return expiryCount;
}

const toggleViewCount = () => {
viewCountEnabled = !viewCountEnabled;
const img = document.querySelector(".container > img");
Expand All @@ -185,5 +187,7 @@ const toggleViewCount = () => {
}
}

toggleBtn.addEventListener('click', toggleViewCount);

//backBtn.addEventListener('click', () => {})

0 comments on commit f50067f

Please sign in to comment.