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

Use refs for tree panel.

Again, use classname instead of ID for styling.

Also Docs.Favorites no more calls for some global treePanel component,
but is instead given the TreePanel it should use.
parent 6bf9e2a8
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -6,6 +6,14 @@ Ext.define("Docs.Favorites", {
    storeName: 'Favorites',
    singleton: true,

    /**
     * Associates Favorites with Docs TreePanel component.
     * @param {Docs.view.tree.Tree} tree
     */
    setTree: function(tree) {
        this.tree = tree;
    },

    /**
     * Adds class to favorites
     *
@@ -15,7 +23,7 @@ Ext.define("Docs.Favorites", {
        if (!this.has(cls)) {
            this.store.add({cls: cls});
            this.syncStore();
            Ext.getCmp("treePanelCmp").setFavorite(cls, true);
            this.tree.setFavorite(cls, true);
        }
    },

@@ -28,7 +36,7 @@ Ext.define("Docs.Favorites", {
        if (this.has(cls)) {
            this.store.removeAt(this.store.findExact('cls', cls));
            this.syncStore();
            Ext.getCmp("treePanelCmp").setFavorite(cls, false);
            this.tree.setFavorite(cls, false);
        }
    },

+6 −2
Original line number Diff line number Diff line
@@ -28,6 +28,10 @@ Ext.define('Docs.controller.Classes', {
        {
            ref: 'classOverview',
            selector: 'classoverview'
        },
        {
            ref: 'tree',
            selector: 'classtree'
        }
    ],

@@ -40,7 +44,7 @@ Ext.define('Docs.controller.Classes', {
        });

        this.control({
            '#treePanelCmp': {
            'classtree': {
                // Can't simply assign the loadClass function as event
                // handler, because an extra event options object is
                // appended to the event arguments, which we don't
@@ -144,7 +148,7 @@ Ext.define('Docs.controller.Classes', {
                this.getTabPanel().setLoading(false);
            }

            Ext.getCmp('treePanelCmp').selectClass(cls.name);
            this.getTree().selectClass(cls.name);
        }

        if (anchor) {
+3 −2
Original line number Diff line number Diff line
@@ -10,8 +10,7 @@ Ext.define('Docs.view.tree.Tree', {
        'Docs.History'
    ],

    id: 'treePanelCmp',
    cls: 'iScroll',
    cls: 'class-tree iScroll',
    folderSort: true,
    useArrows: true,
    rootVisible: false,
@@ -42,6 +41,8 @@ Ext.define('Docs.view.tree.Tree', {

        this.on("itemclick", this.onItemClick, this);

        Docs.Favorites.setTree(this);

        this.dockedItems = [
            {
                xtype: 'container',
+1 −1
Original line number Diff line number Diff line
@@ -351,7 +351,7 @@ a:hover {
      display: block; } } }


#treePanelCmp {
.class-tree {
  .x-grid-cell-inner {
    font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-size: 13px;