Skip to content

Commit 3d501f1

Browse files
committed
Fixes #125. (outerHTML is a thing!!)
Lots could be done with thing but I'll leave it for now. Like showing the whole article, or letting you choose what to display, or... some kind of vertical fisheye... man, remember when I had the whole thing fisheyeing? uh it would be cool to have shortcut buttons to traverse the tree, expanding/collapsing to a certain spot... and highlighting what page thing it corresponded to... but.....
1 parent 64a9e8d commit 3d501f1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/tree/tree.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
}));
8080
}
8181

82-
root.children = root.children.slice(48,68);
82+
root.children = root.children.slice(45,65);
8383
// truncate(root);
8484
root.children.forEach(collapse);
8585
// collapse(root);
@@ -272,10 +272,15 @@
272272

273273
d.iframe.append("div.title").text(function(d) { return d.description ? d.description : d.name; });
274274

275+
// could also append label for class list, like so...
276+
// d.iframe.append("div.class-list").text(function(d) { return d.ref ? d.ref.classList : ''; });
277+
278+
var inlineStyle = "<style>img{max-width:100%;}</style>";
279+
275280
var iframeEl = d.iframe.append("iframe");
276281
var iframeDocument = iframeEl.node().contentWindow.document;
277282
iframeDocument.open();
278-
iframeDocument.write(d.ref.innerHTML);
283+
iframeDocument.write(inlineStyle + d.ref.outerHTML);
279284
iframeDocument.close();
280285
}
281286

@@ -342,7 +347,7 @@
342347
{"name":"html","description":"document root element"},
343348
{"name":"i","description":"italic text style"},
344349
{"name":"iframe","description":"inline subwindow"},
345-
{"name":"img","description":"Embedded image"},
350+
{"name":"img","description":"embedded image"},
346351
{"name":"input","description":"form control"},
347352
{"name":"ins","description":"inserted text"},
348353
{"name":"isindex","description":"single line prompt"},

0 commit comments

Comments
 (0)