mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-02-22 22:10:03 +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:
parent
0d928c05a5
commit
83eb368f40
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user