{"version":3,"file":"responsiveiframe.min.js","sources":["../src/responsiveiframe.js"],"sourcesContent":["/* jshint ignore:start */\ndefine(['jquery', 'core/log'], function ($, log) {\n\n    \"use strict\"; // jshint ;_;\n\n    log.debug('responsive iframe initialising');\n\n    return {\n        defheight: 150,\n        defwidth: 300,\n\n        init: function (config) {\n            var theiframe = $('#' + config.iframeid);\n            if (theiframe.length == 0) {\n                theiframe = $('#' + config.iframeid, window.parent.document);\n            }\n            if (theiframe.length > 0) {\n                var iframeprops = {\n                    currentheight: this.defheight,\n                    currentwidth: this.defwidth,\n                    theiframe: theiframe,\n                    thisref: this\n                };\n                this._iframeResize(iframeprops);\n            }\n        },\n        /**\n         * Scan for resize of iframe content and resize iframe\n         *\n         * @param theiframe\n         * @return null\n         * @private\n         */\n        _iframeResize: function (iframeprops) {\n            var theiframe = iframeprops.theiframe;\n\n            if (!theiframe || theiframe.length < 1) {\n                return;\n            }\n            var newheight = theiframe[0].contentWindow.document.body.scrollHeight;\n            var newwidth = theiframe[0].contentWindow.document.body.scrollWidth;\n            if (newheight != iframeprops.currentheight || newwidth != iframeprops.currentwidth) {\n                theiframe.attr('height', (newheight) + \"px\");\n                theiframe.attr(\"width\", (newwidth) + \"px\");\n            }\n\n            iframeprops.currentheight = newheight;\n            iframeprops.currentwidth = newwidth;\n\n            setTimeout(iframeprops.thisref._iframeResize, 100, iframeprops);\n\n        }//end of iframe resize\n    };//end of return object\n});\n/* jshint ignore:end */"],"names":["define","$","log","debug","defheight","defwidth","init","config","theiframe","iframeid","length","window","parent","document","iframeprops","currentheight","this","currentwidth","thisref","_iframeResize","newheight","contentWindow","body","scrollHeight","newwidth","scrollWidth","attr","setTimeout"],"mappings":"AACAA,wCAAO,CAAC,SAAU,aAAa,SAAUC,EAAGC,YAIxCA,IAAIC,MAAM,kCAEH,CACHC,UAAW,IACXC,SAAU,IAEVC,KAAM,SAAUC,YACRC,UAAYP,EAAE,IAAMM,OAAOE,aACP,GAApBD,UAAUE,SACVF,UAAYP,EAAE,IAAMM,OAAOE,SAAUE,OAAOC,OAAOC,WAEnDL,UAAUE,OAAS,EAAG,KAClBI,YAAc,CACdC,cAAeC,KAAKZ,UACpBa,aAAcD,KAAKX,SACnBG,UAAWA,UACXU,QAASF,WAERG,cAAcL,eAU3BK,cAAe,SAAUL,iBACjBN,UAAYM,YAAYN,aAEvBA,aAAaA,UAAUE,OAAS,QAGjCU,UAAYZ,UAAU,GAAGa,cAAcR,SAASS,KAAKC,aACrDC,SAAWhB,UAAU,GAAGa,cAAcR,SAASS,KAAKG,YACpDL,WAAaN,YAAYC,eAAiBS,UAAYV,YAAYG,eAClET,UAAUkB,KAAK,SAAWN,UAAa,MACvCZ,UAAUkB,KAAK,QAAUF,SAAY,OAGzCV,YAAYC,cAAgBK,UAC5BN,YAAYG,aAAeO,SAE3BG,WAAWb,YAAYI,QAAQC,cAAe,IAAKL"}