Skip to content

Commit b32ce02

Browse files
committed
fix issue where pattern type was not resolving, causing the pattern type view all pages to overwrite index, only to be overwritten by the last index, covering up the issue
fixes #452
1 parent 76c79a7 commit b32ce02

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

core/lib/ui_builder.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,9 +500,13 @@ var ui_builder = function () {
500500
//todo this isn't quite working yet
501501
//typePatterns = typePatterns.concat(getPatternItems(patternlab, patternType));
502502

503-
//render the viewall template
503+
//get the appropriate patternType
504+
var anyPatternOfType = _.find(typePatterns, function (pat) {
505+
return pat.patternType && pat.patternType !== '';});
506+
507+
//render the viewall template for the type
504508
var viewAllHTML = buildViewAllHTML(patternlab, typePatterns, patternType);
505-
writeFile(paths.public.patterns + p.subdir + '/index.html', mainPageHeadHtml + viewAllHTML + footerHTML);
509+
writeFile(paths.public.patterns + anyPatternOfType.patternType + '/index.html', mainPageHeadHtml + viewAllHTML + footerHTML);
506510

507511
//determine if we should omit this patterntype completely from the viewall page
508512
var omitPatternType = styleGuideExcludes && styleGuideExcludes.length

0 commit comments

Comments
 (0)