OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview | 6 * @fileoverview |
7 * settings-slider wraps a paper-slider. It maps the slider's values from a | 7 * settings-slider wraps a paper-slider. It maps the slider's values from a |
8 * linear UI range to a range of real values. When |value| does not map exactly | 8 * linear UI range to a range of real values. When |value| does not map exactly |
9 * to a tick mark, it interpolates to the nearest tick. | 9 * to a tick mark, it interpolates to the nearest tick. |
10 * | 10 * |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 var difference = Math.abs(arr[i] - value); | 129 var difference = Math.abs(arr[i] - value); |
130 if (difference < minDifference) { | 130 if (difference < minDifference) { |
131 closestIndex = i; | 131 closestIndex = i; |
132 minDifference = difference; | 132 minDifference = difference; |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 assert(typeof closestIndex != 'undefined'); | 136 assert(typeof closestIndex != 'undefined'); |
137 return closestIndex; | 137 return closestIndex; |
138 }, | 138 }, |
| 139 |
| 140 /** |
| 141 * TODO(scottchen): temporary fix until polymer gesture bug resolved. See: |
| 142 * https://github.com/PolymerElements/paper-slider/issues/186 |
| 143 * @private |
| 144 */ |
| 145 resetTrackLock_: function() { |
| 146 Polymer.Gestures.gestures.tap.reset(); |
| 147 }, |
139 }); | 148 }); |
OLD | NEW |