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

Unified Diff: third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js

Issue 1401633002: Update Polymer from 1.1.4 -> 1.1.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: dzhioev@ review 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
Index: third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
diff --git a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
index 6c13939d7dd6431ee19146fea8beb0576571f3fe..c220d50f96644fd39e9854d9e6553ff84923fec4 100644
--- a/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
+++ b/third_party/polymer/v1_0/components-chromium/paper-radio-group/paper-radio-group-extracted.js
@@ -1,5 +1,4 @@
-
- Polymer({
+Polymer({
is: 'paper-radio-group',
behaviors: [
@@ -14,6 +13,12 @@
properties: {
/**
+ * Fired when the radio group selection changes.
+ *
+ * @event paper-radio-group-changed
+ */
+
+ /**
* Overriden from Polymer.IronSelectableBehavior
*/
attrForSelected: {
@@ -35,6 +40,14 @@
selectable: {
type: String,
value: 'paper-radio-button'
+ },
+
+ /**
+ * If true, radio-buttons can be deselected
+ */
+ allowEmptySelection: {
+ type: Boolean,
+ value: false
}
},
@@ -50,10 +63,16 @@
if (this.selected) {
var oldItem = this._valueToItem(this.selected);
- // Do not allow unchecking the selected item.
if (this.selected == value) {
- oldItem.checked = true;
- return;
+ // If deselecting is allowed we'll have to apply an empty selection.
+ // Otherwise, we should force the selection to stay and make this
+ // action a no-op.
+ if (this.allowEmptySelection) {
+ value = '';
+ } else {
+ oldItem.checked = true;
+ return;
+ }
}
if (oldItem)
@@ -93,4 +112,4 @@
this.select(this._indexToValue(newIndex));
},
- });
+ });

Powered by Google App Engine
This is Rietveld 408576698