diff --git a/core/lib/object_factory.js b/core/lib/object_factory.js index 7dad7637d..8fe9aa902 100644 --- a/core/lib/object_factory.js +++ b/core/lib/object_factory.js @@ -37,7 +37,7 @@ var Pattern = function (relPath, data) { this.patternGroup = this.name.substring(this.name.indexOf('-') + 1, this.name.indexOf('-', 4) + 1 - this.name.indexOf('-') + 1); // the sub-group this pattern belongs to. - this.patternSubGroup = this.subdir.substring(this.subdir.indexOf('/') + 4); // 'global' + this.patternSubGroup = path.basename(this.subdir).replace(/^\d*-/, ''); // 'global' // Not sure what this is used for. this.flatPatternPath = this.subdir.replace(/[\/\\]/g, '-'); // '00-atoms-00-global' diff --git a/core/lib/ui_builder.js b/core/lib/ui_builder.js index f2f548066..7e99135ee 100644 --- a/core/lib/ui_builder.js +++ b/core/lib/ui_builder.js @@ -84,7 +84,7 @@ function buildNavigation(patternlab) { //if there is one or more slashes in the subdir, get everything after //the last slash. if no slash, get the whole subdir string and strip //any numeric + hyphen prefix - patternSubTypeName = pattern.subdir.split('/').pop().replace(/^\d*\-/, ''); + patternSubTypeName = pattern.subdir.split(path.sep).pop().replace(/^\d*\-/, ''); //get the patternSubTypeItem patternSubTypeItemName = pattern.patternName.replace(/-/g, ' ');