diff --git a/template/app/view/examples/InlinePreview.js b/template/app/view/examples/InlinePreview.js index a743782cbeb6ae228a96b6d6c7f1f809597e93ff..33668f2001306a036273cb53a9d4853d1df442df 100644 --- a/template/app/view/examples/InlinePreview.js +++ b/template/app/view/examples/InlinePreview.js @@ -90,21 +90,21 @@ Ext.define('Docs.view.examples.InlinePreview', { */ update: function(code) { var options = this.options; - var iframe = document.getElementById(this.iframeId); + var iframe = Ext.get(this.iframeId); var callback = Ext.Function.bind(this.iframeCallback, this); if (iframe) { // 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() { + iframe.on('load', function() { Ext.Function.defer(function() { // Append newline to code, otherwise we might result in syntax error as // eval() doesn't like when code ends with line-comment. - iframe.contentWindow.loadInlineExample(code+"\n", options, callback); + iframe.dom.contentWindow.loadInlineExample(code+"\n", options, callback); }, 100); - }; - iframe.src = "eg-iframe.html"; + }, this, {single: true}); + iframe.dom.src = "eg-iframe.html"; } },