ユーザーが .notification-popup をクリックするとポップアップする通知 div があります。ユーザーがそのDIVの外側をクリックするたびにpopop divが非表示になるようにしようとしています。
現在、私はこれを持っています:
$('body').on('click', function (e) {
                    $('.notification-list-wrapper').each(function () {
                        //the 'is' for buttons that trigger popups
                        //the 'has' for icons within a button that triggers a popup
                        if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.notification-list-wrapper').has(e.target).length === 0) {
                            $(this).hide();
                        }
                    });
                });
これでは、.notification-popup をクリックしても何も起こりません。
何を変更すればよいですか?