Temporarily removed the popup zapper

This implementation is too slow and cumbersome; we'll replace it with
something else soon
print-window-tiddler
Jeremy Ruston 2012-06-19 10:39:13 +01:00
rodzic 0d928c05a5
commit 83eb368f40
1 zmienionych plików z 21 dodań i 21 usunięć

Wyświetl plik

@ -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<controllers.length; t++) {
controllers[t].dispatchEvent(cancelPopupEvent);
}
}
});
// 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<controllers.length; t++) {
// controllers[t].dispatchEvent(cancelPopupEvent);
// }
// }
// });
// Display the PageTemplate
var template = "$:/templates/PageTemplate",
renderer = $tw.wiki.parseTiddler(template);