Commit 4a079664 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix passing options to Touch preview iframe.

parent b7e3d3db
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -43,14 +43,14 @@ Ext.define('Docs.view.examples.InlinePreview', {
     * @param {String} code  The code to run inside iframe.
     */
    update: function(code) {
        var options = this.options.raw;
        var options = this.options;
        var iframe = document.getElementById(this.getIframeId());
        // Something is not quite ready when onload fires.
        // I'm unsure what I should wait for. So I'm currently adding just this nasty delay.
        // 1 ms works in Chrome, Firefox wants something bigger. Works in IE too.
        iframe.onload = function() {
            Ext.Function.defer(function() {
                iframe.contentWindow.refreshPage(code, options.raw);
                iframe.contentWindow.refreshPage(code, options);
            }, 100);
        };
        iframe.src = Docs.touchExamplesUi ? "touchIframe.html" : "extIframe.html";
+2 −2
Original line number Diff line number Diff line
@@ -8,10 +8,10 @@
    <link rel="stylesheet" type="text/css" href="touch/resources/css/sencha-touch.css">

    <script type="text/javascript">
        var refreshPage = function(code, raw) {
        var refreshPage = function(code, options) {
            try {
                document.body.innerHTML = '';
                if (!raw) {
                if (!options.raw) {
                    code = "Ext.setup({onReady: function(){" + code + "}});";
                }
                eval(code);