Skip to content

Commit

Permalink
Merge pull request #68 from bestguy/improveSSR
Browse files Browse the repository at this point in the history
Improve SSR Support
  • Loading branch information
bestguy authored Oct 13, 2019
2 parents 71ca606 + 30ff436 commit 5b2a585
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion docs/iframe.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
}</style><style>#root[hidden],
#docs-root[hidden] {
display: none !important;
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.7762ee4bc6f59b445be1.bundle.js"></script><script src="vendors~main.7762ee4bc6f59b445be1.bundle.js"></script><script src="main.7762ee4bc6f59b445be1.bundle.js"></script></body></html>
}</style></head><body><div class="sb-nopreview sb-wrapper"><div class="sb-nopreview_main"><h1 class="sb-nopreview_heading sb-heading">No Preview</h1><p>Sorry, but you either have no stories or none are selected somehow.</p><ul><li>Please check the Storybook config.</li><li>Try reloading the page.</li></ul><p>If the problem persists, check the browser console, or the terminal you've run Storybook from.</p></div></div><div class="sb-errordisplay sb-wrapper"><pre id="error-message" class="sb-heading"></pre><pre class="sb-errordisplay_code"><code id="error-stack"></code></pre></div><div id="root"></div><div id="docs-root"></div><script src="runtime~main.683d91b2c7d5e7bd26b8.bundle.js"></script><script src="vendors~main.683d91b2c7d5e7bd26b8.bundle.js"></script><script src="main.683d91b2c7d5e7bd26b8.bundle.js"></script></body></html>
2 changes: 2 additions & 0 deletions docs/main.683d91b2c7d5e7bd26b8.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/main.683d91b2c7d5e7bd26b8.bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions docs/main.7762ee4bc6f59b445be1.bundle.js

This file was deleted.

1 change: 0 additions & 1 deletion docs/main.7762ee4bc6f59b445be1.bundle.js.map

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sveltestrap",
"version": "3.2.5",
"version": "3.2.6-0",
"main": "dist/sveltestrap.js",
"module": "dist/sveltestrap.es.js",
"jsnext:main": "dist/sveltestrap.es.js",
Expand Down
2 changes: 1 addition & 1 deletion src/Collapse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
navbar && 'navbar-collapse',
);
let windowWidth = window.innerWidth;
let windowWidth = 0;
let _wasMaximazed = false;
const minWidth = {};
Expand Down
4 changes: 2 additions & 2 deletions src/UncontrolledCollapse.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
if (
typeof toggler === 'string' &&
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
document &&
document.createElement
) {
let selection = document.querySelectorAll(toggler);
if (!selection.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/UncontrolledFade.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
if (
typeof toggler === 'string' &&
typeof window !== 'undefined' &&
window.document &&
window.document.createElement
document &&
document.createElement
) {
let selection = document.querySelectorAll(toggler);
if (!selection.length) {
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export function getOriginalBodyPadding() {
const style = window.getComputedStyle(document.body, null);
const style = window ? window.getComputedStyle(document.body, null) : {};

return parseInt((style && style.getPropertyValue('padding-right')) || 0, 10);
}
Expand All @@ -23,7 +23,7 @@ export function setScrollbarWidth(padding) {
}

export function isBodyOverflowing() {
return document.body.clientWidth < window.innerWidth;
return window ? document.body.clientWidth < window.innerWidth : false;
}

export function isObject(value) {
Expand Down

0 comments on commit 5b2a585

Please sign in to comment.