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

Unified Diff: third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js

Issue 1766433002: Roll Polymer to 1.3.1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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
Index: third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js
index 9c9d1ec9f435edc5c29a3247539b00cc3d4dfda5..65083e9885e5cf5f2181480cb48a3c88006a9cc2 100644
--- a/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/iron-selector/iron-selection-extracted.js
@@ -55,16 +55,19 @@
*/
setItemSelected: function(item, isSelected) {
if (item != null) {
- if (isSelected) {
- this.selection.push(item);
- } else {
- var i = this.selection.indexOf(item);
- if (i >= 0) {
- this.selection.splice(i, 1);
+ if (isSelected !== this.isSelected(item)) {
+ // proceed to update selection only if requested state differs from current
+ if (isSelected) {
+ this.selection.push(item);
+ } else {
+ var i = this.selection.indexOf(item);
+ if (i >= 0) {
+ this.selection.splice(i, 1);
+ }
+ }
+ if (this.selectCallback) {
+ this.selectCallback(item, isSelected);
}
- }
- if (this.selectCallback) {
- this.selectCallback(item, isSelected);
}
}
},

Powered by Google App Engine
This is Rietveld 408576698