wire/modules/Inputfield/InputfieldImage/InputfieldImage.js
/**
	 * Initialize an .InputfieldImage for lightbox (magnific) and sortable
	 * 
	 * @param $inputfield
	 * 
	 */
Initialize an .InputfieldImage for lightbox (magnific) and sortable

@param $inputfield
Initialize an . InputfieldImage for lightbox ( magnific ) and sortable @param $inputfield
function initInputfield($inputfield) {
		if($inputfield.hasClass('InputfieldStateCollapsed')) return;
		var maxFiles = parseInt($inputfield.find(".InputfieldImageMaxFiles").val());
		var $gridImages = $inputfield.find('.gridImages');
		var size = getCookieData($inputfield, 'size');
		var mode = getCookieData($inputfield, 'mode');
		var ragged = mode == 'left' ? true : false;
		var renderValueMode = $inputfield.hasClass('InputfieldRenderValueMode');
		if(!size) size = $gridImages.attr('data-gridsize');
		size = parseInt(size);
		if(!renderValueMode && ($inputfield.hasClass('InputfieldImageEditAll') || mode == 'list')) {
			var listSize = getCookieData($inputfield, 'listSize');
			setListSize($inputfield, listSize);
		} else {
			setGridSize($inputfield, size, ragged);
		}
		if(!$inputfield.hasClass('InputfieldImageInit')) {
			$inputfield.addClass('InputfieldImageInit');
			if(renderValueMode) {
				return setupMagnificForRenderValue($inputfield);
			} else if(maxFiles == 1) {
				$inputfield.addClass('InputfieldImageMax1');
				setupMagnificForSingle($inputfield);
			} else {
				setupSortable($gridImages);
			}
			setupImageListToggle($inputfield);
			setupSizeSlider($inputfield);
		}
		checkInputfieldWidth($inputfield);
		$inputfield.on('change', '.InputfieldFileActionSelect', function() {
			var $note = $(this).next('.InputfieldFileActionNote');
			if($(this).val().length) {
				$note.fadeIn();
			} else {
				$note.hide();
			}
		}); 
	}
function initInputfield ( $inputfield ) { if ( $inputfield . hasClass ( 'InputfieldStateCollapsed' ) ) return ; var maxFiles = parseInt ( $inputfield . find ( ".InputfieldImageMaxFiles" ) . val ( ) ) ; var $gridImages = $inputfield . find ( '.gridImages' ) ; var size = getCookieData ( $inputfield , 'size' ) ; var mode = getCookieData ( $inputfield , 'mode' ) ; var ragged = mode == 'left' ? true : false ; var renderValueMode = $inputfield . hasClass ( 'InputfieldRenderValueMode' ) ; if ( ! size ) size = $gridImages . attr ( 'data-gridsize' ) ; size = parseInt ( size ) ; if ( ! renderValueMode && ( $inputfield . hasClass ( 'InputfieldImageEditAll' ) || mode == 'list' ) ) { var listSize = getCookieData ( $inputfield , 'listSize' ) ; setListSize ( $inputfield , listSize ) ; } else { setGridSize ( $inputfield , size , ragged ) ; } if ( ! $inputfield . hasClass ( 'InputfieldImageInit' ) ) { $inputfield . addClass ( 'InputfieldImageInit' ) ; if ( renderValueMode ) { return setupMagnificForRenderValue ( $inputfield ) ; } else if ( maxFiles == 1 ) { $inputfield . addClass ( 'InputfieldImageMax1' ) ; setupMagnificForSingle ( $inputfield ) ; } else { setupSortable ( $gridImages ) ; } setupImageListToggle ( $inputfield ) ; setupSizeSlider ( $inputfield ) ; } checkInputfieldWidth ( $inputfield ) ; $inputfield . on ( 'change' , '.InputfieldFileActionSelect' , function ( ) { var $note = $ ( this ) . next ( '.InputfieldFileActionNote' ) ; if ( $ ( this ) . val ( ) . length ) { $note . fadeIn ( ) ; } else { $note . hide ( ) ; } } ) ; }
Initialize an .InputfieldImage for lightbox (magnific) and sortable
Initialize an . InputfieldImage for lightbox ( magnific ) and sortable
//console.log('initInputfield'); //console.log($inputfield);