Unpack the object returned by getBoundingClientRect()

Embedding the return object directly doesn't survive the object being
passed as an event parameter.

Fixes #114
print-window-tiddler
Jeremy Ruston 2013-07-25 16:58:42 +01:00
rodzic a79e876806
commit 602b9d34e4
1 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -95,10 +95,18 @@ LinkWidget.prototype.handleClickEvent = function(event) {
event.target.setAttribute("target","_blank");
return true;
} else {
var bounds = this.renderer.domNode.getBoundingClientRect();
$tw.utils.dispatchCustomEvent(event.target,"tw-navigate",{
navigateTo: this.to,
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.stopPropagation();