/**
 * form Functions Registered
 */
import IGDATAPOOLFE from '@dp/ig_datapool_fe.js';

const formFunctionPlugin = {
    initFields(form) {
        this.init(form);
    },
    init(form) {
	this.form = form;
	form.querySelectorAll('select[data-dp-init]').forEach(function(el){
	    let dpInit = el.getAttribute('data-dp-init');
	    if (window[dpInit]) {
		window[dpInit](el);
	    }
	    //document.querySelector[el.getAttribute('data-dp-init')](el);
	});
    }
};
IGDATAPOOLFE.addPlugin('formFunction', formFunctionPlugin);
export default formFunctionPlugin;
