Skip to content

Commit

Permalink
Add click background close popup
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterOfTheTiger authored and MasterOfTheTiger committed Feb 11, 2018
1 parent f41bc72 commit 60b4199
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,21 @@ document.getElementById("back").addEventListener("click", function(){
/*document.getElementById("star").addEventListener("click", function(){
localStorage["favorite"] = getYesterdaysDate();
})*/
function closeSharer() {
document.getElementById("sharing").style.display = "none";
document.getElementById("fade").style.display = "none";
document.getElementById("fade").removeEventListener("click", closeSharer)
}
document.getElementById("share").addEventListener("click", function(){
document.getElementById("sharing").style.display = "block";
document.getElementById("fade").style.display = "block";
setTimeout(function(){document.getElementById("fade").addEventListener("click", closeSharer)}, 600);
});
document.getElementById("closeSharing").addEventListener("click", function(){
document.getElementById("sharing").style.display = "none";
document.getElementById("fade").style.display = "none";
});

//Opens links in popup in new tab
$(document).ready(function(){
$('body').on('click', 'a', function(){
Expand Down

0 comments on commit 60b4199

Please sign in to comment.