Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2536)

Unified Diff: lib/src/iron-selector/iron-selectable.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/src/iron-selector/iron-multi-selectable.html ('k') | lib/src/iron-selector/iron-selection.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/iron-selector/iron-selectable.html
diff --git a/lib/src/iron-selector/iron-selectable.html b/lib/src/iron-selector/iron-selectable.html
index 26bb2655148af3dbcabcee0601b249e545c9b120..eb1fb5fd431ab6e2548b92892004477d3143cad4 100644
--- a/lib/src/iron-selector/iron-selectable.html
+++ b/lib/src/iron-selector/iron-selectable.html
@@ -56,8 +56,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
/**
* Gets or sets the selected element. The default is to use the index of the item.
- *
- * @type {string|number}
*/
selected: {
type: String,
@@ -107,12 +105,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
/**
- * The set of excluded elements where the key is the `localName`
+ * The set of excluded elements where the key is the `localName`
* of the element that will be ignored from the item list.
*
+ * @type {object}
* @default {template: 1}
*/
- excludedLocalNames: {
+ _excludedLocalNames: {
type: Object,
value: function() {
return {
@@ -129,11 +128,18 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
created: function() {
this._bindFilterItem = this._filterItem.bind(this);
this._selection = new Polymer.IronSelection(this._applySelection.bind(this));
+ // TODO(cdata): When polymer/polymer#2535 lands, we do not need to do this
+ // book keeping anymore:
+ this.__listeningForActivate = false;
},
attached: function() {
this._observer = this._observeItems(this);
this._contentObserver = this._observeContent(this);
+ if (!this.selectedItem && this.selected) {
+ this._updateSelected(this.attrForSelected,this.selected)
+ }
+ this._addListener(this.activateEvent);
},
detached: function() {
@@ -200,11 +206,17 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_addListener: function(eventName) {
+ if (!this.isAttached || this.__listeningForActivate) {
+ return;
+ }
+
+ this.__listeningForActivate = true;
this.listen(this, eventName, '_activateHandler');
},
_removeListener: function(eventName) {
this.unlisten(this, eventName, '_activateHandler');
+ this.__listeningForActivate = false;
},
_activateEventChanged: function(eventName, old) {
@@ -221,7 +233,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
},
_filterItem: function(node) {
- return !this.excludedLocalNames[node.localName];
+ return !this._excludedLocalNames[node.localName];
},
_valueToItem: function(value) {
« no previous file with comments | « lib/src/iron-selector/iron-multi-selectable.html ('k') | lib/src/iron-selector/iron-selection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698