| OLD | NEW | 
|---|
| 1 <!-- | 1 <!-- | 
| 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 2 Copyright (c) 2014 The Polymer Project Authors. All rights reserved. | 
| 3 This code may only be used under the BSD style license found at http://polymer.g
     ithub.io/LICENSE.txt | 3 This code may only be used under the BSD style license found at http://polymer.g
     ithub.io/LICENSE.txt | 
| 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 4 The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt | 
| 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
     BUTORS.txt | 5 The complete set of contributors may be found at http://polymer.github.io/CONTRI
     BUTORS.txt | 
| 6 Code distributed by Google as part of the polymer project is also | 6 Code distributed by Google as part of the polymer project is also | 
| 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
     TS.txt | 7 subject to an additional IP rights grant found at http://polymer.github.io/PATEN
     TS.txt | 
| 8 --> | 8 --> | 
| 9 | 9 | 
| 10 <!-- | 10 <!-- | 
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 53       background-color: red; | 53       background-color: red; | 
| 54     } | 54     } | 
| 55 | 55 | 
| 56 @group Paper Elements | 56 @group Paper Elements | 
| 57 @element paper-toggle-button | 57 @element paper-toggle-button | 
| 58 @homepage github.io | 58 @homepage github.io | 
| 59 --> | 59 --> | 
| 60 | 60 | 
| 61 <link rel="import" href="../paper-radio-button/paper-radio-button.html"> | 61 <link rel="import" href="../paper-radio-button/paper-radio-button.html"> | 
| 62 | 62 | 
| 63 <polymer-element name="paper-toggle-button" attributes="checked" role="button" a
     ria-pressed="false" tabindex="0"> | 63 <polymer-element name="paper-toggle-button" attributes="checked disabled" role="
     button" aria-pressed="false" tabindex="0"> | 
| 64 <template> | 64 <template> | 
| 65 | 65 | 
| 66   <link rel="stylesheet" href="paper-toggle-button.css"> | 66   <link rel="stylesheet" href="paper-toggle-button.css"> | 
| 67 | 67 | 
| 68   <div id="toggleContainer"> | 68   <div id="toggleContainer" disabled?="{{disabled}}"> | 
| 69 | 69 | 
| 70     <div id="toggleBar" checked?="{{checked}}"></div> | 70     <div id="toggleBar" checked?="{{checked}}"></div> | 
| 71 | 71 | 
| 72     <paper-radio-button id="toggleRadio" toggles checked="{{checked}}" on-change
     ="{{changeAction}}" on-core-change="{{stopPropagation}}" | 72     <paper-radio-button id="toggleRadio" toggles checked="{{checked}}" on-change
     ="{{changeAction}}" on-core-change="{{stopPropagation}}" | 
| 73         on-trackstart="{{trackStart}}" on-trackx="{{trackx}}" on-trackend="{{tra
     ckEnd}}"></paper-radio-button> | 73         on-trackstart="{{trackStart}}" on-trackx="{{trackx}}" on-trackend="{{tra
     ckEnd}}"></paper-radio-button> | 
| 74 | 74 | 
| 75   </div> | 75   </div> | 
| 76 | 76 | 
| 77 </template> | 77 </template> | 
| 78 <script> | 78 <script> | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 92      */ | 92      */ | 
| 93 | 93 | 
| 94     /** | 94     /** | 
| 95      * Gets or sets the state, `true` is checked and `false` is unchecked. | 95      * Gets or sets the state, `true` is checked and `false` is unchecked. | 
| 96      * | 96      * | 
| 97      * @attribute checked | 97      * @attribute checked | 
| 98      * @type boolean | 98      * @type boolean | 
| 99      * @default false | 99      * @default false | 
| 100      */ | 100      */ | 
| 101     checked: false, | 101     checked: false, | 
|  | 102 | 
|  | 103     /** | 
|  | 104      * If true, the toggle button is disabled.  A disabled toggle button cannot | 
|  | 105      * be tapped or dragged to change the checked state. | 
|  | 106      * | 
|  | 107      * @attribute disabled | 
|  | 108      * @type boolean | 
|  | 109      * @default false | 
|  | 110      */ | 
|  | 111     disabled: false, | 
| 102 | 112 | 
| 103     trackStart: function(e) { | 113     trackStart: function(e) { | 
| 104       this._w = this.$.toggleBar.offsetLeft + this.$.toggleBar.offsetWidth; | 114       this._w = this.$.toggleBar.offsetLeft + this.$.toggleBar.offsetWidth; | 
| 105       e.preventTap(); | 115       e.preventTap(); | 
| 106     }, | 116     }, | 
| 107 | 117 | 
| 108     trackx: function(e) { | 118     trackx: function(e) { | 
| 109       this._x = Math.min(this._w, | 119       this._x = Math.min(this._w, | 
| 110           Math.max(0, this.checked ? this._w + e.dx : e.dx)); | 120           Math.max(0, this.checked ? this._w + e.dx : e.dx)); | 
| 111       this.$.toggleRadio.classList.add('dragging'); | 121       this.$.toggleRadio.classList.add('dragging'); | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 135     }, | 145     }, | 
| 136 | 146 | 
| 137     stopPropagation: function(e) { | 147     stopPropagation: function(e) { | 
| 138       e.stopPropagation(); | 148       e.stopPropagation(); | 
| 139     } | 149     } | 
| 140 | 150 | 
| 141   }); | 151   }); | 
| 142 | 152 | 
| 143 </script> | 153 </script> | 
| 144 </polymer-element> | 154 </polymer-element> | 
| OLD | NEW | 
|---|