diff --git a/core/modules/startup.js b/core/modules/startup.js index a283a4588..9c5b9e1d0 100644 --- a/core/modules/startup.js +++ b/core/modules/startup.js @@ -49,27 +49,27 @@ exports.startup = function() { // Host-specific startup if($tw.browser) { // Install the popup zapper - document.body.addEventListener("click",function(event) { - // Is the click within a popup? - var inPopup = false, - e = event.target; - while(e !== document) { - if($tw.utils.hasClass(e,"tw-popup")) { - inPopup = true; - } - e = e.parentNode; - } - // If we're not in a popup, then send out an event to cancel all popups - if(!inPopup) { - var cancelPopupEvent = document.createEvent("Event"); - cancelPopupEvent.initEvent("tw-cancel-popup",true,true); - cancelPopupEvent.targetOfCancel = event.target; - var controllers = document.querySelectorAll(".tw-popup-controller"); - for(var t=0; t