Loading template/app/controller/Examples.js +2 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ Ext.define('Docs.controller.Examples', { url: exampleId, success: function(json) { inlineEg.codeEditor.setValue(json.data.files["basic_grid_panel.js"].content); window.frames['egIframe' + inlineEg.iframeId].refreshPage(inlineEg.codeEditor.getValue(), ''); window.frames[inlineEg.getIframeId()].refreshPage(inlineEg.codeEditor.getValue(), ''); }, scope: this }); Loading Loading @@ -157,7 +157,7 @@ Ext.define('Docs.controller.Examples', { }, refreshPreview: function(cmp) { document.getElementById('egIframe' + cmp.iframeId).contentWindow.refreshPage(cmp.codeEditor.getValue(), ''); document.getElementById(cmp.getIframeId()).contentWindow.refreshPage(cmp.codeEditor.getValue(), ''); } }); No newline at end of file template/app/view/examples/Inline.js +17 −5 Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ Ext.define('Docs.view.examples.Inline', { constrainTo: false }, statics: { iframeId: 0 }, dockedItems: [{ xtype: 'toolbar', dock: 'left', Loading Loading @@ -52,10 +56,6 @@ Ext.define('Docs.view.examples.Inline', { }, initComponent: function() { Docs.view.examples.Inline.prototype.iframeId = Docs.view.examples.Inline.prototype.iframeId || 0; Docs.view.examples.Inline.prototype.iframeId = Docs.view.examples.Inline.prototype.iframeId + 1; this.iframeId = Docs.view.examples.Inline.prototype.iframeId; this.items = [{ cmpName: 'code', style: 'border: 0', Loading @@ -67,7 +67,7 @@ Ext.define('Docs.view.examples.Inline', { this.items.push({ bodyPadding: 10, cmpName: 'preview', html: '<iframe id="egIframe' + this.iframeId + '" src="egIframe.html" style="width: 100%; height: 100%; border: 0"></iframe>' html: '<iframe id="' + this.getIframeId() + '" src="egIframe.html" style="width: 100%; height: 100%; border: 0"></iframe>' }); this.items.push({ Loading @@ -79,6 +79,18 @@ Ext.define('Docs.view.examples.Inline', { this.callParent(arguments); }, /** * Returns iframe ID for this inline example component. * @return {String} */ getIframeId: function() { if (!this.iframeId) { this.statics().iframeId += 1; this.iframeId = "egIframe" + this.statics().iframeId; } return this.iframeId; }, /** * Syncs the height with number of lines in code example. */ Loading Loading
template/app/controller/Examples.js +2 −2 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ Ext.define('Docs.controller.Examples', { url: exampleId, success: function(json) { inlineEg.codeEditor.setValue(json.data.files["basic_grid_panel.js"].content); window.frames['egIframe' + inlineEg.iframeId].refreshPage(inlineEg.codeEditor.getValue(), ''); window.frames[inlineEg.getIframeId()].refreshPage(inlineEg.codeEditor.getValue(), ''); }, scope: this }); Loading Loading @@ -157,7 +157,7 @@ Ext.define('Docs.controller.Examples', { }, refreshPreview: function(cmp) { document.getElementById('egIframe' + cmp.iframeId).contentWindow.refreshPage(cmp.codeEditor.getValue(), ''); document.getElementById(cmp.getIframeId()).contentWindow.refreshPage(cmp.codeEditor.getValue(), ''); } }); No newline at end of file
template/app/view/examples/Inline.js +17 −5 Original line number Diff line number Diff line Loading @@ -14,6 +14,10 @@ Ext.define('Docs.view.examples.Inline', { constrainTo: false }, statics: { iframeId: 0 }, dockedItems: [{ xtype: 'toolbar', dock: 'left', Loading Loading @@ -52,10 +56,6 @@ Ext.define('Docs.view.examples.Inline', { }, initComponent: function() { Docs.view.examples.Inline.prototype.iframeId = Docs.view.examples.Inline.prototype.iframeId || 0; Docs.view.examples.Inline.prototype.iframeId = Docs.view.examples.Inline.prototype.iframeId + 1; this.iframeId = Docs.view.examples.Inline.prototype.iframeId; this.items = [{ cmpName: 'code', style: 'border: 0', Loading @@ -67,7 +67,7 @@ Ext.define('Docs.view.examples.Inline', { this.items.push({ bodyPadding: 10, cmpName: 'preview', html: '<iframe id="egIframe' + this.iframeId + '" src="egIframe.html" style="width: 100%; height: 100%; border: 0"></iframe>' html: '<iframe id="' + this.getIframeId() + '" src="egIframe.html" style="width: 100%; height: 100%; border: 0"></iframe>' }); this.items.push({ Loading @@ -79,6 +79,18 @@ Ext.define('Docs.view.examples.Inline', { this.callParent(arguments); }, /** * Returns iframe ID for this inline example component. * @return {String} */ getIframeId: function() { if (!this.iframeId) { this.statics().iframeId += 1; this.iframeId = "egIframe" + this.statics().iframeId; } return this.iframeId; }, /** * Syncs the height with number of lines in code example. */ Loading