Home | History | Annotate | Download | only in paper-checkbox
      1 
      2 
      3   Polymer('paper-checkbox', {
      4     
      5     /**
      6      * Fired when the checked state changes.
      7      *
      8      * @event change
      9      */
     10     
     11     toggles: true,
     12 
     13     checkedChanged: function() {
     14       var cl = this.$.checkbox.classList;
     15       cl.toggle('checked', this.checked);
     16       cl.toggle('unchecked', !this.checked);
     17       cl.toggle('checkmark', !this.checked);
     18       cl.toggle('box', this.checked);
     19       this.setAttribute('aria-checked', this.checked ? 'true': 'false');
     20       this.fire('change');
     21     },
     22 
     23     checkboxAnimationEnd: function() {
     24       var cl = this.$.checkbox.classList;
     25       cl.toggle('checkmark', this.checked && !cl.contains('checkmark'));
     26       cl.toggle('box', !this.checked && !cl.contains('box'));
     27     }
     28 
     29   });
     30   
     31