1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-06-29 08:33:07 +00:00

Temporarily removed the popup zapper

This implementation is too slow and cumbersome; we'll replace it with
something else soon
This commit is contained in:
Jeremy Ruston 2012-06-19 10:39:13 +01:00
parent 0d928c05a5
commit 83eb368f40

View File

@ -49,27 +49,27 @@ exports.startup = function() {
// Host-specific startup // Host-specific startup
if($tw.browser) { if($tw.browser) {
// Install the popup zapper // Install the popup zapper
document.body.addEventListener("click",function(event) { // document.body.addEventListener("click",function(event) {
// Is the click within a popup? // // Is the click within a popup?
var inPopup = false, // var inPopup = false,
e = event.target; // e = event.target;
while(e !== document) { // while(e !== document) {
if($tw.utils.hasClass(e,"tw-popup")) { // if($tw.utils.hasClass(e,"tw-popup")) {
inPopup = true; // inPopup = true;
} // }
e = e.parentNode; // e = e.parentNode;
} // }
// If we're not in a popup, then send out an event to cancel all popups // // If we're not in a popup, then send out an event to cancel all popups
if(!inPopup) { // if(!inPopup) {
var cancelPopupEvent = document.createEvent("Event"); // var cancelPopupEvent = document.createEvent("Event");
cancelPopupEvent.initEvent("tw-cancel-popup",true,true); // cancelPopupEvent.initEvent("tw-cancel-popup",true,true);
cancelPopupEvent.targetOfCancel = event.target; // cancelPopupEvent.targetOfCancel = event.target;
var controllers = document.querySelectorAll(".tw-popup-controller"); // var controllers = document.querySelectorAll(".tw-popup-controller");
for(var t=0; t<controllers.length; t++) { // for(var t=0; t<controllers.length; t++) {
controllers[t].dispatchEvent(cancelPopupEvent); // controllers[t].dispatchEvent(cancelPopupEvent);
} // }
} // }
}); // });
// Display the PageTemplate // Display the PageTemplate
var template = "$:/templates/PageTemplate", var template = "$:/templates/PageTemplate",
renderer = $tw.wiki.parseTiddler(template); renderer = $tw.wiki.parseTiddler(template);