mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-11-16 15:28:24 +00:00
eventcatcher widget: Add viewport-relative coordinates
This is useful because we get viewport relative coordinates from the link and action-navigate widgets
This commit is contained in:
@@ -86,6 +86,10 @@ EventWidget.prototype.render = function(parent,nextSibling) {
|
||||
catcherNodeRect = self.domNode.getBoundingClientRect();
|
||||
variables["event-fromcatcher-posx"] = (event.clientX - catcherNodeRect.left).toString();
|
||||
variables["event-fromcatcher-posy"] = (event.clientY - catcherNodeRect.top).toString();
|
||||
|
||||
//Add variables for event X and Y position relative to the viewport
|
||||
variables["event-fromviewport-posx"] = event.clientX.toString();
|
||||
variables["event-fromviewport-posy"] = event.clientY.toString();
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user