File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,11 @@ var patternlab_engine = function (config) {
473
473
var viewAllPathsPartialHtml = pattern_assembler . renderPattern ( viewAllPathsTemplate , { 'viewallpaths' : JSON . stringify ( patternlab . viewAllPaths ) } ) ;
474
474
475
475
//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
+ } , {
477
481
'ishControls' : ishControlsPartialHtml ,
478
482
'patternNav' : patternNavPartialHtml ,
479
483
'patternPaths' : patternPathsPartialHtml ,
Original file line number Diff line number Diff line change 26
26
" templates" ,
27
27
" pages"
28
28
],
29
+ "defaultPattern" : " all" ,
29
30
"ignored-extensions" : [" scss" , " DS_Store" , " less" ],
30
31
"ignored-directories" : [" scss" ],
31
32
"debug" : false ,
Original file line number Diff line number Diff line change 469
469
}
470
470
471
471
// load the iframe source
472
- var patternName = "all" ;
472
+ var patternName = window . defaultPattern || "all" ;
473
473
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
475
477
if ( ( oGetVars . p != undefined ) || ( oGetVars . pattern != undefined ) ) {
476
478
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 ;
479
479
}
480
480
481
481
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 ;
482
484
document . getElementById ( "title" ) . innerHTML = "Pattern Lab - " + patternName ;
483
485
history . replaceState ( { "pattern" : patternName } , null , null ) ;
484
486
}
Original file line number Diff line number Diff line change 10
10
<link rel =" stylesheet" href =" styleguide/css/vendor/prism.css" media =" all" />
11
11
<script src =" http://ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js" ></script >
12
12
<script >window .jQuery || document .write (' <script src="styleguide/js/vendor/jquery.js"><\/ script>' ) </script >
13
+ <script >window .defaultPattern = ' { { defaultPattern} } ' ; </script >
13
14
</head >
14
15
<body id =" patternlab-body" >>
15
16
<!-- Style Guide Header-->
21
22
</div >
22
23
</header >
23
24
<!-- End Style Guide Header-->
24
-
25
+
25
26
<!-- Iframe -->
26
27
<div id =" sg-vp-wrap" >
27
28
<div id =" sg-cover" ></div >
91
92
<script src =" styleguide/js/pattern-finder.js" ></script >
92
93
93
94
</body >
94
- </html >
95
+ </html >
You can’t perform that action at this time.
0 commit comments