Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
polymer-ui-breadcrumbs: revert the behavior so tapping on crumb will not
Browse files Browse the repository at this point in the history
update the UI
  • Loading branch information
frankiefu committed Oct 24, 2013
1 parent 9191b9b commit 630eeda
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 17 deletions.
1 change: 1 addition & 0 deletions polymer-ui-breadcrumbs/metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<polymer-ui-breadcrumbs crumbs='[{"label": "Overview"}, {"label": "Subitem1"}, {"label": "Subitem2"},{"label": "Subitem3"}]'></polymer-ui-breadcrumbs>
</template>
<property name="crumbs" kind="json"></property>
<property name="selected" kind="string"></property>
<template id="imports">
<link rel="import" href="polymer-ui-breadcrumbs.html">
</template>
Expand Down
8 changes: 2 additions & 6 deletions polymer-ui-breadcrumbs/polymer-ui-breadcrumbs.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ license that can be found in the LICENSE file.
color: #aaa;
}

.label[hidden] {
display: none;
}

.label.polymer-selected > a {
.label:last-of-type > a {
color: black;
}

Expand All @@ -40,6 +36,6 @@ polymer-ui-icon {
transform: rotate(270deg);
}

.label.polymer-selected ~ polymer-ui-icon {
polymer-ui-icon:last-of-type {
display: none !important;
}
13 changes: 2 additions & 11 deletions polymer-ui-breadcrumbs/polymer-ui-breadcrumbs.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,25 +64,16 @@
<link rel="stylesheet" href="polymer-ui-breadcrumbs.css">
<div id="crumbs">
<template repeat="{{crumbs}}">
<li class="label" hidden?="{{hidden}}"><a href="{{href}}" disabled?="{{!href}}">{{label}}</a></li>
<li class="label"><a href="{{href}}" disabled?="{{!href}}">{{label}}</a></li>
<polymer-ui-icon icon="dropdown"></polymer-ui-icon>
</template>
</div>
<polymer-selector target="{{$.crumbs}}" itemsSelector="li" selected="{{selected}}" selectedModel="{{selectedCrumb}}"></polymer-selector>
</template>
<script>
Polymer('polymer-ui-breadcrumbs', {
createdCallback: function() {
created: function() {
this.crumbs = [];
this.super(arguments);
},
crumbsChanged: function() {
this.selected = this.crumbs ? this.crumbs.length - 1 : null;
},
selectedChanged: function() {
this.crumbs && this.crumbs.forEach(function(c, i) {
c.hidden = i > this.selected;
}.bind(this));
}
});
</script>
Expand Down

0 comments on commit 630eeda

Please sign in to comment.