(function ( $ ) {
	'use strict';

	qodefCore.shortcodes.ginevra_core_single_image = {};

	$( document ).ready(
		function () {
			qodefSingleImage.init();
		}
	);

	var qodefSingleImage = {
		init: function () {
			this.holder = $( '.qodef-single-image.qodef-has-appear' );

			if ( this.holder.length ) {
				this.holder.each(
					function () {
						qodefSingleImage.initItem( $( this ) );
					}
				);
			}
		},
		initItem: function ( $holder ) {

			qodefCore.qodefIsInViewport.check(
				$holder,
				function () {
					qodef.qodefWaitForImages.check(
						$holder,
						function () {
							$holder.addClass( 'qodef--appeared' );
						}
					);
				},
			);
		},
	};

	qodefCore.shortcodes.ginevra_core_single_image.qodefSingleImage = qodefSingleImage;

})( jQuery );
