Commit 61e3f9b6 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make inline example preview visible by default for Touch.

parent 2749c147
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -116,7 +116,9 @@ Ext.define('Docs.controller.InlineExamples', {
        example.codeEditor.setValue(code);
        var activeItem = example.layout.getActiveItem();
        if (activeItem.cmpName == 'preview') {
            example.showPreview(function() {
                this.refreshPreview(example);
            }, this);
        }
        example.updateHeight();
    },
+6 −5
Original line number Diff line number Diff line
@@ -59,8 +59,14 @@ Ext.define('Docs.view.examples.Inline', {
                bodyPadding: 2,
                bodyStyle: 'background: #f7f7f7',
                autoScroll: true
            },
            {
                bodyPadding: '0 10',
                cmpName: 'preview',
                html: this.getHtml()
            }
        ];
        this.activeItem = Docs.touchExamplesUi ? 1 : 0;

        this.callParent(arguments);
    },
@@ -80,11 +86,6 @@ Ext.define('Docs.view.examples.Inline', {
     */
    showPreview: function(callback, scope) {
        if (!this.previewInitialized) {
            this.add({
                bodyPadding: '0 10',
                cmpName: 'preview',
                html: this.getHtml()
            });
            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.