Hi Simon,
that is almost the right place yes, if you have a look at
|core/modules/startup/startup.js| [1], you will see that it initializes
it without the rootElement being given anyway. The next problem is that
all widgets regardless of the window they are rendered in will use
|$tw.popup.triggerPopup()|, so we can't have multiple popup handler
(i.e. one per window). The actual event listener however will be
registered in |$tw.popup.show()|.
As it stands I see two ways you could make the core properly handle this:
* Turn the global window variable in |core/modules/startup/window.js|
into |$tw.openWindows| and make sure that all open windows including
the main one are listed there and then have the Popup mechanism
iterate through these and register itself (to all of them).
* Have the Popup mechanism use [2] to register itself to the
appropriate window by default and only change this if the
rootElement option was set. (Not sure how well this would work in
other browsers, but it would require the least change)
[1]
https://github.com/Jermolene/TiddlyWiki5/blob/master/core/modules/startup/startup.js#L118
[2] https://developer.mozilla.org/en-US/docs/Web/API/Node/ownerDocument
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/54bca73e-ca52-c640-ff4e-cd37d4692dca%40googlemail.com.
For more options, visit https://groups.google.com/d/optout.