Skip to content

Commit

Permalink
better rendering of navigation subdirs
Browse files Browse the repository at this point in the history
  • Loading branch information
e2tha-e committed Oct 3, 2015
1 parent 34793f5 commit 0109d6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builder/object_factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
this.subdir = subdir;
this.name = subdir.replace(/[\/\\]/g, '-') + '-' + this.fileName; //this is the unique name with the subDir
this.jsonFileData = data || {};
this.patternName = this.fileName.substring(this.fileName.indexOf('-') + 1); //this is the display name for the ui
this.patternName = this.fileName.replace(/^\d*\-/, ''); //this is the display name for the ui. strip numeric + hyphen prefixes
this.patternLink = this.name + '/' + this.name + '.html';
this.patternGroup = this.name.substring(this.name.indexOf('-') + 1, this.name.indexOf('-', 4) + 1 - this.name.indexOf('-') + 1);
this.patternSubGroup = subdir.substring(subdir.indexOf('/') + 4);
Expand Down
5 changes: 4 additions & 1 deletion builder/patternlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,10 @@ var patternlab_engine = function () {
var bucket = patternlab.buckets[bucketIndex];

//get the navItem
var navItemName = pattern.subdir.split('-').pop();
//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
var navItemName = pattern.subdir.split('/').pop().replace(/^\d*\-/, '');

//get the navSubItem
var navSubItemName = pattern.patternName.replace(/-/g, ' ');
Expand Down

0 comments on commit 0109d6e

Please sign in to comment.