| Index: third_party/polymer/v0_8/components-chromium/more-routing/more-route-selector-extracted.js
|
| diff --git a/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selector-extracted.js b/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selector-extracted.js
|
| index a6e5e01f2caa799fb454b68991e279a219de9c7d..07d17d1e5764b2390641af7a9a0dec026c9a8566 100644
|
| --- a/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selector-extracted.js
|
| +++ b/third_party/polymer/v0_8/components-chromium/more-routing/more-route-selector-extracted.js
|
| @@ -99,6 +99,7 @@ Polymer({
|
| * defined by the current URL.
|
| */
|
| _onSelectedItemChanged: function(event) {
|
| + if (this._settingSelection) return;
|
| var route = this._routeForItem(event.detail.value);
|
| if (!route) return;
|
| route.navigateTo();
|
| @@ -114,8 +115,23 @@ Polymer({
|
|
|
| _onMoreRouteChange: function(event) {
|
| if (!this._managedSelector) return;
|
| - var route = event.detail.newRoute;
|
| - this._managedSelector.select(this.routes.indexOf(route));
|
| +
|
| + var selected = '';
|
| +
|
| + var index = this.routes.indexOf(event.detail.newRoute);
|
| + var attrForSelected = this._managedSelector.attrForSelected;
|
| + if (!attrForSelected) {
|
| + selected = index;
|
| + } else {
|
| + var item = this._managedSelector.items[index];
|
| + if (item)
|
| + selected = item[attrForSelected] || item.getAttribute(attrForSelected);
|
| + }
|
| +
|
| + // Make sure that we don't turn around and re-navigate
|
| + this._settingSelection = true;
|
| + this._managedSelector.select(selected);
|
| + this._settingSelection = false;
|
| },
|
|
|
| _findTargetSelector: function() {
|
|
|