Commit 1eac9ee2 authored by limscoder's avatar limscoder
Browse files

Moved iframeId argument of loadInlineExample into options obj.

parent f3af3cc0
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -94,8 +94,8 @@ Ext.define('Docs.view.examples.InlinePreview', {
     * @param {String} code  The code to run inside iframe.
     */
    update: function(code) {
        var options = this.options,
            iframeId = this.iframeId,
        var iframeId = this.iframeId,
            options = Ext.apply({iframeId: iframeId}, this.options),
            iframe = document.getElementById(iframeId);

        if (iframe) {
@@ -104,7 +104,7 @@ Ext.define('Docs.view.examples.InlinePreview', {
            // 1 ms works in Chrome, Firefox wants something bigger. Works in IE too.
            iframe.onload = function() {
                Ext.Function.defer(function() {
                    iframe.contentWindow.loadInlineExample(iframeId, code, options);
                    iframe.contentWindow.loadInlineExample(code, options);
                }, 100);
            };
            iframe.src = "eg-iframe.html";
+3 −3
Original line number Diff line number Diff line
@@ -9,14 +9,14 @@
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css">

    <script type="text/javascript">
        function loadInlineExample(exampleId, code, options) {
        function loadInlineExample(code, options) {
            try {
                document.body.innerHTML = '';
                eval(code);
                window.top.Docs.view.examples.InlinePreview.previewSuccess(exampleId);
                window.top.Docs.view.examples.InlinePreview.previewSuccess(options.iframeId);
            } catch (e) {
                document.body.innerHTML = e;
                window.top.Docs.view.examples.InlinePreview.previewFailure(exampleId, e);
                window.top.Docs.view.examples.InlinePreview.previewFailure(options.iframeId, e);
            }
        }
    </script>