File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 502
502
updateViewportWidth ( vpWidth ) ;
503
503
}
504
504
505
- // load the iframe source
506
- var patternName = "all" ;
507
- var patternPath = "" ;
508
- var iFramePath = window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + "styleguide/html/styleguide.html?" + Date . now ( ) ;
505
+ // set up the defaults for the
506
+ var baseIframePath = window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) ;
507
+ var patternName = ( ( config . defaultPattern !== undefined ) && ( typeof config . defaultPattern === 'string' ) && ( config . defaultPattern . trim ( ) . length > 0 ) ) ? config . defaultPattern : 'all' ;
508
+ var iFramePath = baseIframePath + "styleguide/html/styleguide.html?" + Date . now ( ) ;
509
509
if ( ( oGetVars . p !== undefined ) || ( oGetVars . pattern !== undefined ) ) {
510
510
patternName = ( oGetVars . p !== undefined ) ? oGetVars . p : oGetVars . pattern ;
511
- patternPath = urlHandler . getFileName ( patternName ) ;
512
- iFramePath = ( patternPath !== "" ) ? window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + patternPath + "?" + Date . now ( ) : iFramePath ;
513
511
}
514
512
515
513
if ( patternName !== "all" ) {
514
+ patternPath = urlHandler . getFileName ( patternName ) ;
515
+ iFramePath = ( patternPath !== "" ) ? baseIframePath + patternPath + "?" + Date . now ( ) : iFramePath ;
516
516
document . getElementById ( "title" ) . innerHTML = "Pattern Lab - " + patternName ;
517
517
history . replaceState ( { "pattern" : patternName } , null , null ) ;
518
518
}
You can’t perform that action at this time.
0 commit comments