From 6d7aaafedcaf9e08b025f92f3e88068e0442cb92 Mon Sep 17 00:00:00 2001 From: Daniel Tam Date: Sun, 24 Apr 2022 20:11:56 -0500 Subject: [PATCH] allow modal to be closed by clicking anywhere --- index.html | 2 +- js/layout.js | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index d3529ff..4cc9d5f 100755 --- a/index.html +++ b/index.html @@ -488,7 +488,7 @@ - + diff --git a/js/layout.js b/js/layout.js index bff73b0..534fba5 100755 --- a/js/layout.js +++ b/js/layout.js @@ -120,7 +120,8 @@ var Layout = function () { var handleWorkPopup = function() { var overlay = $('.work-popup-overlay'), close = $('.work-popup-close'), - trigger = $('.work-popup-trigger'); + trigger = $('.work-popup-trigger'), + content = $('.work-popup-content'); trigger.on('click', function() { $(this).find('.work-popup-overlay').removeClass('work-popup-overlay-show'); @@ -131,6 +132,11 @@ var Layout = function () { e.stopPropagation(); overlay.removeClass('work-popup-overlay-show'); }); + + overlay.on('click', function(e) { + e.stopPropagation(); + overlay.removeClass('work-popup-overlay-show'); + }); } return {