Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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('cr.ui', function() { | 5 cr.define('cr.ui', function() { |
| 6 /** | 6 /** |
| 7 * Creates a new button element. The repeating button behaves like a | 7 * Creates a new button element. The repeating button behaves like a |
| 8 * keyboard button, which auto-repeats if held. This button is designed | 8 * keyboard button, which auto-repeats if held. This button is designed |
| 9 * for use with controls such as brightness and volume adjustment buttons. | 9 * for use with controls such as brightness and volume adjustment buttons. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 this.intervalCallback_ = undefined; | 135 this.intervalCallback_ = undefined; |
| 136 } | 136 } |
| 137 }, | 137 }, |
| 138 | 138 |
| 139 /** | 139 /** |
| 140 * Dispatches the action associated with keeping this button pressed. | 140 * Dispatches the action associated with keeping this button pressed. |
| 141 * @private | 141 * @private |
| 142 */ | 142 */ |
| 143 buttonHeld_: function() { | 143 buttonHeld_: function() { |
| 144 cr.dispatchSimpleEvent(this, RepeatingButton.Event.BUTTON_HELD); | 144 cr.dispatchSimpleEvent(this, RepeatingButton.Event.BUTTON_HELD); |
| 145 }, | |
| 146 | |
| 147 /** | |
| 148 * Getter for the initial delay before repeating. | |
| 149 * @return {number} The delay in milliseconds. | |
|
arv1
2011/11/01 17:49:37
Use @type for getters/setters
| |
| 150 */ | |
| 151 get repeatDelay() { | |
| 152 return this.holdDelayTime_; | |
| 153 }, | |
| 154 | |
| 155 /** | |
| 156 * Getter for the repeat interval. | |
| 157 * @return {number} The repeat interval in milliseconds. | |
| 158 */ | |
| 159 get repeatInterval() { | |
| 160 return this.holdRepeatIntervalTime_; | |
| 145 } | 161 } |
| 146 }; | 162 }; |
| 147 | 163 |
| 148 return { | 164 return { |
| 149 RepeatingButton: RepeatingButton | 165 RepeatingButton: RepeatingButton |
| 150 }; | 166 }; |
| 151 }); | 167 }); |
| 152 | 168 |
| OLD | NEW |