Commit a2875c47 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Disable the whole DocTests component while loading.

parent 580ed3de
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -31,14 +31,6 @@ Ext.define('Docs.controller.DocTests', {
        {
            ref: 'index',
            selector: '#doctestsindex'
        },
        {
            ref: 'testContainer',
            selector: '#testcontainer'
        },
        {
            ref: 'docTests',
            selector: 'doctestsindex'
        }
    ],

@@ -74,7 +66,7 @@ Ext.define('Docs.controller.DocTests', {
     */
    locateExamples: function(store) {
        this.classesLeft = Docs.data.classes.length;
        this.getTestContainer().setDisabled(true);
        this.getIndex().disable();
        store.removeAll();
        Ext.each(Docs.data.classes, function(cls) {
            this.locateClsExamples(store, cls.name);
@@ -113,12 +105,12 @@ Ext.define('Docs.controller.DocTests', {
                        code: exampleCode,
                        status: '<span class="doc-test-ready">ready</span>'
                    });
                    this.getDocTests().setStatus(true, store.getCount() + " examples loaded.");
                    this.getIndex().setStatus(true, store.getCount() + " examples loaded.");
                }, this);

                this.classesLeft--;
                if (this.classesLeft === 0) {
                    this.getTestContainer().setDisabled(false);
                    this.getIndex().enable();
                }
            },
            failure: function(response, opts) {
+2 −2
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ Ext.define('Docs.view.doctests.Index', {
        }

        if (config.fail + config.pass === 0) {
            Ext.ComponentQuery.query('#testcontainer', this)[0].setDisabled(true);
            this.disable();
        }

        this.clearTestRunner();
@@ -167,7 +167,7 @@ Ext.define('Docs.view.doctests.Index', {
        this.setStatus(config.fail === 0, totalTested + '/' + config.total + ' examples tested, ' + config.fail + ' failures');

        if (config.examples.length < 1) {
            Ext.ComponentQuery.query('#testcontainer', this)[0].setDisabled(false);
            this.enable();
        } else {
            this.runExample(config);
        }