mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-29 15:30:47 +00:00
Unpack the object returned by getBoundingClientRect()
Embedding the return object directly doesn't survive the object being passed as an event parameter. Fixes #114
This commit is contained in:
parent
a79e876806
commit
602b9d34e4
@ -95,10 +95,18 @@ LinkWidget.prototype.handleClickEvent = function(event) {
|
|||||||
event.target.setAttribute("target","_blank");
|
event.target.setAttribute("target","_blank");
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
var bounds = this.renderer.domNode.getBoundingClientRect();
|
||||||
$tw.utils.dispatchCustomEvent(event.target,"tw-navigate",{
|
$tw.utils.dispatchCustomEvent(event.target,"tw-navigate",{
|
||||||
navigateTo: this.to,
|
navigateTo: this.to,
|
||||||
navigateFromNode: this,
|
navigateFromNode: this,
|
||||||
navigateFromClientRect: this.renderer.domNode.getBoundingClientRect()
|
navigateFromClientRect: {
|
||||||
|
top: bounds.top,
|
||||||
|
left: bounds.left,
|
||||||
|
width: bounds.width,
|
||||||
|
right: bounds.right,
|
||||||
|
bottom: bounds.bottom,
|
||||||
|
height: bounds.height
|
||||||
|
}
|
||||||
});
|
});
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
Loading…
Reference in New Issue
Block a user