MCPcopy
hub / github.com/autoNumeric/autoNumeric / detach

Method detach

src/AutoNumeric.js:2846–2857  ·  view source on GitHub ↗

* Detach the current AutoNumeric element from the shared local 'init' list. * This means any changes made on that local shared list will not be transmitted to that element anymore. * Note : The user can provide another AutoNumeric element, and detach this one instead of the current one.

(otherAnElement = null)

Source from the content-addressed store, hash-verified

2844 * @returns {AutoNumeric}
2845 */
2846 detach(otherAnElement = null) { //FIXME test this
2847 let domElementToDetach;
2848 if (!AutoNumericHelper.isNull(otherAnElement)) {
2849 domElementToDetach = otherAnElement.node();
2850 } else {
2851 domElementToDetach = this.domElement;
2852 }
2853
2854 this._removeFromLocalList(domElementToDetach); //FIXME What happens if the selected dom element does not exist in the list?
2855
2856 return this;
2857 }
2858
2859 /**
2860 * Attach the given AutoNumeric element to the shared local 'init' list.

Callers 1

Calls 3

_removeFromLocalListMethod · 0.95
isNullMethod · 0.80
nodeMethod · 0.80

Tested by

no test coverage detected