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

Add load method to cls.Header.

So we can call it similarly to cls.Overview.

Also no more pass initial class config to the header component.
parent bd82682d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ Ext.define('Docs.controller.Classes', {
                classHeader = classCnt.down('classheader'),
                classOverview = classCnt.down('classoverview');

            classHeader.update(classHeader.tpl.apply(cls));
            classHeader.load(cls);
            classOverview.load(cls);

            if (this.getTabPanel()) {
+1 −3
Original line number Diff line number Diff line
@@ -17,9 +17,7 @@ Ext.define('Docs.view.cls.Container', {

    initComponent: function() {
        this.items = [
            Ext.create('Docs.view.cls.Header', {
                docClass: this.docClass
            }),
            Ext.create('Docs.view.cls.Header'),
            Ext.create('Docs.view.cls.TabPanel', {
                docClass: this.docClass,
                flex: 1
+9 −4
Original line number Diff line number Diff line
@@ -4,6 +4,9 @@
Ext.define('Docs.view.cls.Header', {
    extend: 'Ext.container.Container',
    padding: '5 0 17 0',
    // Initially the component will be empty and so the initial height
    // will not be correct if not set explicitly
    height: 47,
    alias: 'widget.classheader',

    tpl: Ext.create('Ext.XTemplate',
@@ -28,9 +31,11 @@ Ext.define('Docs.view.cls.Header', {
        }
    ),

    initComponent: function() {
        this.html = this.tpl.apply(this.docClass || ' ');

        this.callParent(arguments);
    /**
     * Loads class name and icon to header.
     * @param {Object} cls  class config.
     */
    load: function(cls) {
        this.update(this.tpl.apply(cls));
    }
});