if ( typeof Fractal === 'undefined' ) throw "Fractal core.js not loaded";

Fractal.Preview = (function($){

    var Preview = function( el ){
        this.el = el;
        this.iframe = el.find('iframe');
    };

    Preview.prototype = {

        init: function(){
            var self = this;
            this.iframe.iFrameResize({
                log: false,
                initCallback: function(){
                    self.el.addClass('is-ready');
                },
                resizedCallback: function(){
                    self.el.addClass('is-ready');
                }
            });
            setTimeout(function(){
                self.el.addClass('is-ready');
            }, 2000);
        }

    };

    return Preview;

})(jQuery, window);
