Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit a5477b6

Browse files
committed
smarter handling of when to add the pull bar
1 parent a7a728b commit a5477b6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

public/styleguide/js/styleguide.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,10 +372,15 @@
372372
// capture the viewport width that was loaded and modify it so it fits with the pull bar
373373
var origViewportWidth = $("#sg-viewport").width();
374374
$("#sg-gen-container").width(origViewportWidth);
375-
if (screen.width != $(window).width()) {
376-
$("#sg-viewport").width(origViewportWidth - 14);
377-
} else if ('ontouchstart' in document.documentElement) {
375+
376+
var testWidth = screen.width;
377+
if (window.orientation !== undefined) {
378+
testWidth = (window.orientation == 0) ? screen.width : screen.height;
379+
}
380+
if (($(window).width() == testWidth) && ('ontouchstart' in document.documentElement) && ($(window).width() <= 1024)) {
378381
$("#sg-rightpull-container").width(0);
382+
} else {
383+
$("#sg-viewport").width(origViewportWidth - 14);
379384
}
380385
updateSizeReading($("#sg-viewport").width());
381386

0 commit comments

Comments
 (0)