Skip to content
This repository has been archived by the owner on Aug 31, 2024. It is now read-only.

Commit

Permalink
Added checked prop
Browse files Browse the repository at this point in the history
  • Loading branch information
klan committed Aug 2, 2017
1 parent f5dfa05 commit fb4e9af
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions messaging-subscribe-toggle.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<paper-toggle-button id="subscribe"
on-tap="_toggleSubscription"
disabled="[[!_isReady]]"
checked="[[!isEmpty(_topicData)]]">[[value]]</paper-toggle-button>
checked="[[_checked]]">[[value]]</paper-toggle-button>

<paper-icon-button id="tooltip"
icon="error-outline"
Expand Down Expand Up @@ -106,6 +106,11 @@
_supported: {
type: Boolean
},
_checked: {
type: Boolean,
value: false,
computed: '_computeCheckedState(_topicData)'
},
_isReady: {
type: Boolean,
value: false,
Expand Down Expand Up @@ -151,12 +156,12 @@
}
},

_computeReadyState: function(status, online, supported) {
return status && online && supported ? true : false;
_computeCheckedState: function(data) {
return !this.$.topicDocument.valueIsEmpty(data) && data ? true : false;
},

isEmpty: function(value) {
return this.$.topicDocument.valueIsEmpty(value);
_computeReadyState: function(status, online, supported) {
return status && online && supported ? true : false;
}

});
Expand Down

0 comments on commit fb4e9af

Please sign in to comment.