require(['config'], function() {
	require([
		'jquery'
	], function($) {

	});
});

var itp_fn_BIZPOP_POPUP_PREVIEW_info = function(param) {
	fn_ajax_call('/api/pop/info-pop', param, itp_fn_BIZPOP_POPUP_PREVIEW_info_callback, 'GET');
};

var itp_fn_BIZPOP_POPUP_PREVIEW_info_callback = function(result) {
	// console.log(result);
	// C:내용입력, I:이미지
	if(result.popTypeCd == 'C') {
		$('#ITP_FORM_BIZPOP_POPUP_PREVIEW .fnPopupPreview').html(result.popDesc.replace(/(\n|\r\n)/g, '<br>'));
		$('#ITP_FORM_BIZPOP_POPUP_PREVIEW .fnPopupPreview').css('padding', '6px 18px');	
	} else if(result.popTypeCd == 'I') {
		$('#ITP_FORM_BIZPOP_POPUP_PREVIEW .fnPopupPreview').html('<img alt="'+result.popNm+'" src="'+result.fileUrl+'">');
	}	
};

function itp_fn_BIZPOP_POPUP_PREVIEW(parentPopFn, args, returnType) {
	
	// const THIS_FORM_ID = '#ITP_FORM_BIZPOP_POPUP_PREVIEW';	
	itp_fn_BIZPOP_POPUP_PREVIEW_info(args);
	
	$('#ITP_BIZPOP_POPUP_PREVIEW').one('shown.bs.modal', function(e) {		
		itp_fn_fire_window_resize();
	}).one('hidden.bs.modal', function(e) {
		$('#ITP_BIZPOP_POPUP_PREVIEW').remove();
	}).modal('show');
	
};

