Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(44)

Side by Side Diff: chrome/browser/resources/settings/controls/settings_slider.js

Issue 2864563002: MD Settings: Fix dragging slider bugging out the Enter key. (Closed)
Patch Set: also fix this for settings-toggle-button Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698