Skip to content

Commit 66e947b

Browse files
committed
Fix resize bug
1 parent b48de42 commit 66e947b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

scripts/api.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
// Add nav entry.
4242
var anchor = $("<a href='#" + ctor.jsClassName + "'><li>" + ctor.jsClassName + "</li><ul class='subnav'></ul></a>").appendTo(scrollable);
4343

44-
scrollable.height($("html").innerHeight() - 160);
45-
4644
// Add new content.
4745
var contentOutput = contentTemplate.render(ctor);
4846

@@ -54,6 +52,12 @@
5452
});
5553
});
5654

55+
scrollable.height($("html").innerHeight() - 160);
56+
57+
$(window).on("resize", function() {
58+
scrollable.height($("html").innerHeight() - 160);
59+
});
60+
5761
// Highlight the new code blocks.
5862
Prism.highlightAll();
5963

0 commit comments

Comments
 (0)