/**
 * Info bubbles from fieldinfo wrapper
 */
import IGDATAPOOLFE from '@dp/ig_datapool_fe.js';

const fieldWrapperInfoBubblePlugin = {
    initFields(form) {
        this.init(form);
    },
    init(form) {
	let $form = $(form);
	this.form = $form;
	$('.dp-fieldInfoWrapper-infobubble', $form).each(function() {
	    $(this).tooltipster({
		content : $(this).data('infobubble'),
		position : 'bottom-left',
		iconTouch : true,
		maxWidth : $(this).width()
	    });
	});
    }
};
IGDATAPOOLFE.addPlugin('fieldWrapperInfoBubble', fieldWrapperInfoBubblePlugin);
export default fieldWrapperInfoBubblePlugin;
