Skip to content

Commit

Permalink
Make d3_window a bit more lenient.
Browse files Browse the repository at this point in the history
If the passed node is the window itself, return it.
  • Loading branch information
mbostock committed Feb 7, 2015
1 parent ffc1fe9 commit 5040473
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
return node && (node.ownerDocument || node.document).documentElement;
}
function d3_window(node) {
return node && node.ownerDocument.defaultView;
return node && node.ownerDocument ? node.ownerDocument.defaultView : node;
}
if (d3_document) {
try {
Expand Down
Loading

0 comments on commit 5040473

Please sign in to comment.