| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 cr.define('options', function() { | 5 cr.define('options', function() { |
| 6 | 6 |
| 7 var Preferences = options.Preferences; | 7 var Preferences = options.Preferences; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * Allows an element to be disabled for several reasons. | 10 * Allows an element to be disabled for several reasons. |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 decorate: function() { | 289 decorate: function() { |
| 290 PrefInputElement.prototype.decorate.call(this); | 290 PrefInputElement.prototype.decorate.call(this); |
| 291 this.type = 'range'; | 291 this.type = 'range'; |
| 292 | 292 |
| 293 // Listen for user events. | 293 // Listen for user events. |
| 294 // TODO(jhawkins): Add onmousewheel handling once the associated WK bug is | 294 // TODO(jhawkins): Add onmousewheel handling once the associated WK bug is |
| 295 // fixed. | 295 // fixed. |
| 296 // https://bugs.webkit.org/show_bug.cgi?id=52256 | 296 // https://bugs.webkit.org/show_bug.cgi?id=52256 |
| 297 this.addEventListener('keyup', this.handleRelease_.bind(this)); | 297 this.addEventListener('keyup', this.handleRelease_.bind(this)); |
| 298 this.addEventListener('mouseup', this.handleRelease_.bind(this)); | 298 this.addEventListener('mouseup', this.handleRelease_.bind(this)); |
| 299 this.addEventListener('touchcancel', this.handleRelease_.bind(this)); |
| 300 this.addEventListener('touchend', this.handleRelease_.bind(this)); |
| 299 }, | 301 }, |
| 300 | 302 |
| 301 /** | 303 /** |
| 302 * Update the associated pref when when the user releases the slider. | 304 * Update the associated pref when when the user releases the slider. |
| 303 * @private | 305 * @private |
| 304 */ | 306 */ |
| 305 updatePrefFromState_: function() { | 307 updatePrefFromState_: function() { |
| 306 Preferences.setIntegerPref(this.pref, this.mapPositionToPref(this.value), | 308 Preferences.setIntegerPref(this.pref, this.mapPositionToPref(this.value), |
| 307 !this.dialogPref, this.metric); | 309 !this.dialogPref, this.metric); |
| 308 }, | 310 }, |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 553 PrefNumber: PrefNumber, | 555 PrefNumber: PrefNumber, |
| 554 PrefRadio: PrefRadio, | 556 PrefRadio: PrefRadio, |
| 555 PrefRange: PrefRange, | 557 PrefRange: PrefRange, |
| 556 PrefSelect: PrefSelect, | 558 PrefSelect: PrefSelect, |
| 557 PrefTextField: PrefTextField, | 559 PrefTextField: PrefTextField, |
| 558 PrefPortNumber: PrefPortNumber, | 560 PrefPortNumber: PrefPortNumber, |
| 559 PrefButton: PrefButton | 561 PrefButton: PrefButton |
| 560 }; | 562 }; |
| 561 | 563 |
| 562 }); | 564 }); |
| OLD | NEW |