* Add the given object to the local autoNumeric element list. * Note: in order to keep a coherent list, we only add DOM elements in it, not the autoNumeric object. * * @param {HTMLElement|HTMLInputElement} domElement * @param {AutoNumeric} autoNumericObject A reference to the Aut
(domElement, autoNumericObject = null)
| 3738 | * @private |
| 3739 | */ |
| 3740 | _addToLocalList(domElement, autoNumericObject = null) { |
| 3741 | if (AutoNumericHelper.isNull(autoNumericObject)) { |
| 3742 | autoNumericObject = this; |
| 3743 | } |
| 3744 | |
| 3745 | if (!AutoNumericHelper.isUndefined(this.autoNumericLocalList)) { |
| 3746 | this.autoNumericLocalList.set(domElement, autoNumericObject); // Use the DOM element as key, and the AutoNumeric object as the value |
| 3747 | } else { |
| 3748 | AutoNumericHelper.throwError(`The local list provided does not exists when trying to add an element. [${this.autoNumericLocalList}] given.`); |
| 3749 | } |
| 3750 | } |
| 3751 | |
| 3752 | /** |
| 3753 | * Remove the given object from the local autoNumeric element list. |
no test coverage detected