diff --git a/demo/index.html b/demo/index.html
index b7c82c1..4cbfc05 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -48,6 +48,13 @@
Toggle buttons can be checked and disabled
+ Toggle buttons can be made read-only (not editable but still submitted)
+
+
+ Read-only
+
+
+
Toggle buttons can hide the ripple effect using the noink attribute
diff --git a/paper-toggle-button.html b/paper-toggle-button.html
index e5540e1..3b72cd6 100644
--- a/paper-toggle-button.html
+++ b/paper-toggle-button.html
@@ -226,6 +226,11 @@
*
* @event iron-change
*/
+ readonly: {
+ type: Boolean,
+ value: false,
+ reflectToAttribute: true
+ }
},
listeners: {
@@ -280,6 +285,15 @@
ripple.setAttribute('recenters', '');
ripple.classList.add('circle', 'toggle-ink');
return ripple;
+ },
+
+ _tapHandler: function(event) {
+ if (this.readonly) {
+ event.preventDefault();
+ return;
+ }
+ var spr = this.behaviors.find(function(b) { return b._tapHandler; });
+ if (spr) spr._tapHandler.apply(this, arguments);
}
});