Skip to content

Commit 9b7c8cc

Browse files
committed
dist files for the defaultPattern support
1 parent 85a0f51 commit 9b7c8cc

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

dist/styleguide/js/patternlab-viewer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,17 +1801,17 @@ window.addEventListener("message", receiveIframeMessage, false);
18011801
updateViewportWidth(vpWidth);
18021802
}
18031803

1804-
// load the iframe source
1805-
var patternName = "all";
1806-
var patternPath = "";
1807-
var iFramePath = window.location.protocol+"//"+window.location.host+window.location.pathname.replace("index.html","")+"styleguide/html/styleguide.html?"+Date.now();
1804+
// set up the defaults for the
1805+
var baseIframePath = window.location.protocol+"//"+window.location.host+window.location.pathname.replace("index.html","");
1806+
var patternName = ((config.defaultPattern !== undefined) && (typeof config.defaultPattern === 'string') && (config.defaultPattern.trim().length > 0)) ? config.defaultPattern : 'all';
1807+
var iFramePath = baseIframePath+"styleguide/html/styleguide.html?"+Date.now();
18081808
if ((oGetVars.p !== undefined) || (oGetVars.pattern !== undefined)) {
18091809
patternName = (oGetVars.p !== undefined) ? oGetVars.p : oGetVars.pattern;
1810-
patternPath = urlHandler.getFileName(patternName);
1811-
iFramePath = (patternPath !== "") ? window.location.protocol+"//"+window.location.host+window.location.pathname.replace("index.html","")+patternPath+"?"+Date.now() : iFramePath;
18121810
}
18131811

18141812
if (patternName !== "all") {
1813+
patternPath = urlHandler.getFileName(patternName);
1814+
iFramePath = (patternPath !== "") ? baseIframePath+patternPath+"?"+Date.now() : iFramePath;
18151815
document.getElementById("title").innerHTML = "Pattern Lab - "+patternName;
18161816
history.replaceState({ "pattern": patternName }, null, null);
18171817
}

0 commit comments

Comments
 (0)