Skip to content

Commit 29fd7ca

Browse files
committed
add some debugging statements
1 parent f138119 commit 29fd7ca

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/jasmine/assets/get_node_coords.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
*/
66
module.exports = function(node, edge) {
77
edge = edge || '';
8+
console.log('getNodeCoords()');
9+
console.log(' node.outerHTML', node.outerHTML);
10+
console.log(' document contains node?', document.body.contains(node));
811
var bbox = node.getBoundingClientRect();
12+
var getbbox = node.getBBox();
13+
console.log(' bounding client rect', {x: bbox.x, y: bbox.y, width: bbox.width, height: bbox.height});
14+
console.log(' bounding box', {x: getbbox.x, y: getbbox.y, width: getbbox.width, height: getbbox.height});
915
var x, y;
1016

1117
if(edge.indexOf('n') !== -1) y = bbox.top;
@@ -16,5 +22,7 @@ module.exports = function(node, edge) {
1622
else if(edge.indexOf('e') !== -1) x = bbox.right;
1723
else x = (bbox.left + bbox.right) / 2;
1824

25+
console.log(' returning coords:', {x: x, y: y});
26+
1927
return {x: x, y: y};
2028
};

0 commit comments

Comments
 (0)