MCPcopy
hub / github.com/autoNumeric/autoNumeric / attach

Method attach

src/AutoNumeric.js:2868–2875  ·  view source on GitHub ↗

* Attach the given AutoNumeric element to the shared local 'init' list. * When doing that, by default the DOM content is left untouched. * The user can force a reformat with the new shared list options by passing a second argument to `true`. * * @param {AutoNumeric} otherAnElemen

(otherAnElement, reFormat = true)

Source from the content-addressed store, hash-verified

2866 * @returns {AutoNumeric}
2867 */
2868 attach(otherAnElement, reFormat = true) { //FIXME test this
2869 this._addToLocalList(otherAnElement.node()); //FIXME Should we make sure the element is not already in the list?
2870 if (reFormat) {
2871 otherAnElement.update(this.settings);
2872 }
2873
2874 return this;
2875 }
2876
2877 /**
2878 * Format and return the given value, or set the formatted value into the given DOM element if one is passed as an argument.

Callers 1

Calls 3

_addToLocalListMethod · 0.95
nodeMethod · 0.80
updateMethod · 0.80

Tested by

no test coverage detected