This repository was archived by the owner on Dec 10, 2019. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -473,7 +473,11 @@ var patternlab_engine = function (config) {
473473 var viewAllPathsPartialHtml = pattern_assembler . renderPattern ( viewAllPathsTemplate , { 'viewallpaths' : JSON . stringify ( patternlab . viewAllPaths ) } ) ;
474474
475475 //render the patternlab template, with all partials
476- var patternlabSiteHtml = pattern_assembler . renderPattern ( patternlabSiteTemplate , { } , {
476+ debugger ;
477+
478+ var patternlabSiteHtml = pattern_assembler . renderPattern ( patternlabSiteTemplate , {
479+ defaultPattern : patternlab . config . defaultPattern || 'all'
480+ } , {
477481 'ishControls' : ishControlsPartialHtml ,
478482 'patternNav' : patternNavPartialHtml ,
479483 'patternPaths' : patternPathsPartialHtml ,
Original file line number Diff line number Diff line change 2626 " templates" ,
2727 " pages"
2828 ],
29+ "defaultPattern" : " all" ,
2930 "ignored-extensions" : [" scss" , " DS_Store" , " less" ],
3031 "ignored-directories" : [" scss" ],
3132 "debug" : false ,
Original file line number Diff line number Diff line change 469469 }
470470
471471 // load the iframe source
472- var patternName = "all" ;
472+ var patternName = window . defaultPattern || "all" ;
473473 var patternPath = "" ;
474- var iFramePath = window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + "styleguide/html/styleguide.html" ;
474+ var iFramePath = window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + "styleguide/html/styleguide.html" ;
475+
476+ // if we were passed some url parameters, deal with it
475477 if ( ( oGetVars . p != undefined ) || ( oGetVars . pattern != undefined ) ) {
476478 patternName = ( oGetVars . p != undefined ) ? oGetVars . p : oGetVars . pattern ;
477- patternPath = urlHandler . getFileName ( patternName ) ;
478- iFramePath = ( patternPath != "" ) ? window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + patternPath : iFramePath ;
479479 }
480480
481481 if ( patternName != "all" ) {
482+ patternPath = urlHandler . getFileName ( patternName ) ;
483+ iFramePath = ( patternPath != "" ) ? window . location . protocol + "//" + window . location . host + window . location . pathname . replace ( "index.html" , "" ) + patternPath : iFramePath ;
482484 document . getElementById ( "title" ) . innerHTML = "Pattern Lab - " + patternName ;
483485 history . replaceState ( { "pattern" : patternName } , null , null ) ;
484486 }
Original file line number Diff line number Diff line change 1010 <link rel =" stylesheet" href =" styleguide/css/vendor/prism.css" media =" all" />
1111 <script src =" http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" ></script >
1212 <script >window .jQuery || document .write (' <script src="styleguide/js/vendor/jquery.js"><\/ script>' ) </script >
13+ <script >window .defaultPattern = ' { { defaultPattern} } ' ; </script >
1314</head >
1415<body id =" patternlab-body" >>
1516 <!-- Style Guide Header-->
2122 </div >
2223 </header >
2324 <!-- End Style Guide Header-->
24-
25+
2526 <!-- Iframe -->
2627 <div id =" sg-vp-wrap" >
2728 <div id =" sg-cover" ></div >
9192 <script src =" styleguide/js/pattern-finder.js" ></script >
9293
9394</body >
94- </html >
95+ </html >
You can’t perform that action at this time.
0 commit comments