dist/js/cropjs.js
function (crop, setAsCurrent) {
            var _this = this;

            // Create image container element
            var pvDivOuter = document.createElement('div');
            pvDivOuter.id = this._image.id + '_' + crop.id;
            pvDivOuter.classList.add('imc_preview_image_container');

            if (setAsCurrent) {
                pvDivOuter.classList.add('active');
            }

            pvDivOuter.addEventListener(
                'click',
                function () {
                    _this.setActiveCrop(crop);
                }
            );

            // Create inner container element
            var pvDivInner = document.createElement('div');
            pvDivInner.classList.add('imc_preview_image');

            var previewHeight = 90; // Dummy default, will be overriden in _renderUpdatedPreview
            var previewWidth = IMSoftcrop.Ratio.width(previewHeight, crop.ratio.f);
            pvDivInner.style.width = IMSoftcrop.Ratio.width(previewHeight, crop.ratio.f) + 'px';

            // Create span (title) element, including warning element
            var pvSpan = document.createElement('span');
            var pvSpanEm = document.createElement('em');
            var pvWarning = document.createElement('i');
            pvWarning.className = 'fa fa-warning';

            var pvUsed = document.createElement('b');
            var pvUsedCrop = crop;
            pvUsed.className = 'fa fa-check';
            pvUsed.addEventListener(
                'click',
                function(e) {
                    _this.toggleCropUsable(pvUsedCrop)
                    e.preventDefault();
                    e.stopPropagation();
                    return false;
                }
            )

            pvSpanEm.appendChild(document.createTextNode(crop.id))
            pvSpan.appendChild(pvUsed);
            pvSpan.appendChild(pvSpanEm);
            pvSpan.appendChild(pvWarning);


            // Create image element
            var pvImg = document.createElement('img');
            pvImg.src = this._image.src;

            // Put it together
            pvDivInner.appendChild(pvImg);
            pvDivInner.appendChild(pvSpan);
            pvDivOuter.appendChild(pvDivInner);
            this._previewContainer.appendChild(pvDivOuter);


            // Render update
            this._renderUpdatedPreview(crop);
        }
function (crop, setAsCurrent) {
            var _this = this;

            // Create image container element
            var pvDivOuter = document.createElement('div');
            pvDivOuter.id = this._image.id + '_' + crop.id;
            pvDivOuter.classList.add('imc_preview_image_container');

            if (setAsCurrent) {
                pvDivOuter.classList.add('active');
            }

            pvDivOuter.addEventListener(
                'click',
                function () {
                    _this.setActiveCrop(crop);
                }
            );

            // Create inner container element
            var pvDivInner = document.createElement('div');
            pvDivInner.classList.add('imc_preview_image');

            var previewHeight = 90; // Dummy default, will be overriden in _renderUpdatedPreview
            var previewWidth = IMSoftcrop.Ratio.width(previewHeight, crop.ratio.f);
            pvDivInner.style.width = IMSoftcrop.Ratio.width(previewHeight, crop.ratio.f) + 'px';

            // Create span (title) element, including warning element
            var pvSpan = document.createElement('span');
            var pvSpanEm = document.createElement('em');
            var pvWarning = document.createElement('i');
            pvWarning.className = 'fa fa-warning';

            var pvUsed = document.createElement('b');
            var pvUsedCrop = crop;
            pvUsed.className = 'fa fa-check';
            pvUsed.addEventListener(
                'click',
                function(e) {
                    _this.toggleCropUsable(pvUsedCrop)
                    e.preventDefault();
                    e.stopPropagation();
                    return false;
                }
            )

            pvSpanEm.appendChild(document.createTextNode(crop.id))
            pvSpan.appendChild(pvUsed);
            pvSpan.appendChild(pvSpanEm);
            pvSpan.appendChild(pvWarning);


            // Create image element
            var pvImg = document.createElement('img');
            pvImg.src = this._image.src;

            // Put it together
            pvDivInner.appendChild(pvImg);
            pvDivInner.appendChild(pvSpan);
            pvDivOuter.appendChild(pvDivInner);
            this._previewContainer.appendChild(pvDivOuter);


            // Render update
            this._renderUpdatedPreview(crop);
        }
function ( crop , setAsCurrent ) { var _this = this ; // Create image container element var pvDivOuter = document . createElement ( 'div' ) ; pvDivOuter . id = this . _image . id + '_' + crop . id ; pvDivOuter . classList . add ( 'imc_preview_image_container' ) ; if ( setAsCurrent ) { pvDivOuter . classList . add ( 'active' ) ; } pvDivOuter . addEventListener ( 'click' , function ( ) { _this . setActiveCrop ( crop ) ; } ) ; // Create inner container element var pvDivInner = document . createElement ( 'div' ) ; pvDivInner . classList . add ( 'imc_preview_image' ) ; var previewHeight = 90 ; // Dummy default, will be overriden in _renderUpdatedPreview var previewWidth = IMSoftcrop . Ratio . width ( previewHeight , crop . ratio . f ) ; pvDivInner . style . width = IMSoftcrop . Ratio . width ( previewHeight , crop . ratio . f ) + 'px' ; // Create span (title) element, including warning element var pvSpan = document . createElement ( 'span' ) ; var pvSpanEm = document . createElement ( 'em' ) ; var pvWarning = document . createElement ( 'i' ) ; pvWarning . className = 'fa fa-warning' ; var pvUsed = document . createElement ( 'b' ) ; var pvUsedCrop = crop ; pvUsed . className = 'fa fa-check' ; pvUsed . addEventListener ( 'click' , function ( e ) { _this . toggleCropUsable ( pvUsedCrop ) e . preventDefault ( ) ; e . stopPropagation ( ) ; return false ; } ) pvSpanEm . appendChild ( document . createTextNode ( crop . id ) ) pvSpan . appendChild ( pvUsed ) ; pvSpan . appendChild ( pvSpanEm ) ; pvSpan . appendChild ( pvWarning ) ; // Create image element var pvImg = document . createElement ( 'img' ) ; pvImg . src = this . _image . src ; // Put it together pvDivInner . appendChild ( pvImg ) ; pvDivInner . appendChild ( pvSpan ) ; pvDivOuter . appendChild ( pvDivInner ) ; this . _previewContainer . appendChild ( pvDivOuter ) ; // Render update this . _renderUpdatedPreview ( crop ) ; }
Add and render specific crop preview

@param crop
@param setAsCurrent
@private
Add and render specific crop preview