* Called when the increment or decrement button is pressed and held to set new value. * @private * @param increment - is this the increment button or not so the values should be spin accordingly up or down * @param resetVariables - whether to reset the spin-related variables or not
(increment: boolean, resetVariables = false)
| 803 | * @param resetVariables - whether to reset the spin-related variables or not |
| 804 | */ |
| 805 | _spinValue(increment: boolean, resetVariables = false) { |
| 806 | if (resetVariables) { |
| 807 | this._waitTimeout = INITIAL_WAIT_TIMEOUT; |
| 808 | this._speed = INITIAL_SPEED; |
| 809 | this._btnDown = true; |
| 810 | } |
| 811 | this._spinTimeoutId = setTimeout(() => { |
| 812 | if (this._btnDown) { |
| 813 | this._spinStarted = true; |
| 814 | this._modifyValue(increment ? this.step : -this.step); |
| 815 | this._setButtonState(); |
| 816 | if ((!this._incIconDisabled && increment) || (!this._decIconDisabled && !increment)) { |
| 817 | this._spinValue(increment); |
| 818 | } else { |
| 819 | this._resetSpin(); |
| 820 | this._fireChangeEvent(); |
| 821 | } |
| 822 | } |
| 823 | }, this._calcWaitTimeout()); |
| 824 | } |
| 825 | |
| 826 | /** |
| 827 | * Resets spin process |
no test coverage detected