MCPcopy
hub / github.com/autoNumeric/autoNumeric / _getAttributeToWatch

Method _getAttributeToWatch

src/AutoNumeric.js:1621–1637  ·  view source on GitHub ↗

* Return the name of the object attribute that store the current formatted data in the DOM element. * * @returns {string} * @private

()

Source from the content-addressed store, hash-verified

1619 * @private
1620 */
1621 _getAttributeToWatch() {
1622 let attributeToWatch;
1623 if (this.isInputElement) {
1624 attributeToWatch = 'value';
1625 } else {
1626 const nodeType = this.domElement.nodeType;
1627 if (nodeType === Node.ELEMENT_NODE ||
1628 nodeType === Node.DOCUMENT_NODE ||
1629 nodeType === Node.DOCUMENT_FRAGMENT_NODE) {
1630 attributeToWatch = 'textContent';
1631 } else if (nodeType === Node.TEXT_NODE) {
1632 attributeToWatch = 'nodeValue';
1633 }
1634 }
1635
1636 return attributeToWatch;
1637 }
1638
1639 /**
1640 * Save the current raw value into the history table, along with the selection information.

Callers 1

constructorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected