Skip to content

Commit

Permalink
fixed the breadcrumbs so they adhere to specs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vermel, Runn (GE Global Research) committed May 3, 2016
1 parent b0dd23d commit b827464
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
4 changes: 4 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v0.9.1
====================
* fixed the breadcrumbs so they adhere to specs

v0.9.0
====================
* Upgrade to Polymer 1.4.0
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "px-context-browser",
"version": "0.9.0",
"version": "0.9.1",
"main": [
"px-context-browser.html"
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "px-context-browser",
"author": "General Electric",
"description": "A Px component",
"version": "0.9.0",
"version": "0.9.1",
"private": true,
"extName" : null,
"repository" :
Expand Down
28 changes: 20 additions & 8 deletions px-context-browser.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,17 @@ <h1 class="epsilon caps weight--normal u-m0" on-click="toggleColumnBrowser">
<i class="fa fa-caret-down"></i>
</h1>
<ul class="list-inline list-inline--delimited">
<template is="dom-repeat" items="{{openedBreadcrumbs}}">
<li>{{item}}</li>
</template>
<!-- <template is="dom-repeat" items="{{openedBreadcrumbs}}"> -->
<li>{{selectedItemParent}}</li>
<!-- </template> -->
</ul>
</div>
</header>
<div id="ruler" class$="{{isItemHidden(showColumnBrowser)}} flex flex--col">
<div class$="{{isItemHidden(showColumnBrowser)}} flex flex--col">
<ul class="breadcrumbs list-inline list-inline--delimited u-pv-">
<template is="dom-repeat" id="breadcrumbs" items="{{parentNodes}}">
<li class$="{{isItemHidden(item.hideBreadcrumb)}} u-pv--">
<li class$="{{isItemHidden(!item.hideBreadcrumb)}} u-pv--">
<span class="breadcrumb" on-click="handleBreadcrumbClick">{{item.name}}</span>
</li>
</template>
Expand Down Expand Up @@ -253,6 +253,16 @@ <h1 class="epsilon caps weight--normal u-m0" on-click="toggleColumnBrowser">
type: Array,
value: function() {return [];}
},
/**
* The parent of the selected Item. used right under the selected item, and shows up when the item is minimized
* @type {String}
* @default ''
* @private {true}
*/
selectedItemParent: {
type: String,
value: ''
},
/**
* This attributes allows you to use the "hasChildren" or "children" properties inside your json, to show the chevron which indicates this item has children.When this attribute is true, it checks for the "hasChildren" or "children" properties inside your json, and if they exist, the chevron - which indicates this item has children - is shown.
* @type {Boolean Optional}
Expand Down Expand Up @@ -413,11 +423,13 @@ <h1 class="epsilon caps weight--normal u-m0" on-click="toggleColumnBrowser">
var i,
len=this.parentNodes.length;
this.openedBreadcrumbs = [];
for (i=0; i<len;i++) {
if (this.getItemLabel(this.parentNodes[i])) {
this.push('openedBreadcrumbs', this.getItemLabel(this.parentNodes[i]));
}
for (i=0; i<len;i++) {
if (this.getItemLabel(this.parentNodes[i])) {
this.push('openedBreadcrumbs', this.getItemLabel(this.parentNodes[i]));
}
}
//set the selected item's parent for the sudo breadcrumb right below the selected item.
this.selectedItemParent = this.openedBreadcrumbs[this.openedBreadcrumbs.length-2];
},
/**
* @param {Object} item
Expand Down

0 comments on commit b827464

Please sign in to comment.