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

Remove old code for dealing with classes in HoverMenu.

The menus now only contain links to members.

Also remove code dealing with close buttons in menus, which hasn't been
needed for quite a while.
parent d81d33d9
Loading
Loading
Loading
Loading
+1 −13
Original line number Diff line number Diff line
@@ -12,14 +12,8 @@ Ext.define('Docs.view.HoverMenu', {
    /**
     * @cfg {Number} colHeight  maximum number of items in one column.
     * When more than that, items are placed into multiple columns.
     * Defaults to 25 (current maximum length of history).
     */
    columnHeight: 25,
    /**
     * @cfg {Boolean} showCloseButtons  true to show "x" after each menu item.
     * Defaults to false.
     */
    showCloseButtons: false,

    initComponent: function() {
        this.renderTo = Ext.getBody();
@@ -31,9 +25,6 @@ Ext.define('Docs.view.HoverMenu', {
                '<tpl for=".">',
                    '<div class="item">',
                        '{[this.renderLink(values)]}',
                        '<tpl if="this.showCloseButtons">',
                            '<a class="close" href="#" rel="{cls}">x</a>',
                        '</tpl>',
                    '</div>',
                    // Start new column when columnHeight reached
                    '<tpl if="xindex % this.columnHeight === 0 && xcount &gt; xindex">',
@@ -45,14 +36,11 @@ Ext.define('Docs.view.HoverMenu', {
            '</table>',
            {
                columnHeight: this.columnHeight,
                showCloseButtons: this.showCloseButtons,
                renderLink: function(values) {
                    var url = values.url || values.cls;
                    var label = values.label || values.cls;
                    var tags = Ext.Array.map(Docs.data.signatures, function(s) {
                        return values.meta[s.key] ? '<span class="signature '+s.key+'">'+(s["short"])+'</span>' : '';
                    }).join(' ');
                    return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2}</a>', url, label, tags);
                    return Ext.String.format('<a href="#!/api/{0}" rel="{0}" class="docClass">{1} {2}</a>', values.url, values.label, tags);
                }
            }
        );
+6 −24
Original line number Diff line number Diff line
@@ -10,20 +10,13 @@ Ext.define('Docs.view.HoverMenuButton', {
    ],

    /**
     * @cfg {Ext.data.Store} store
     * Store with menu items (required).
     * @cfg {Ext.data.Store} store (required)
     * Store with menu items.
     */

    /**
     * @cfg {Object} menuCfg
     * Additional config options for {@link Docs.view.HoverMenu}
     */
    menuCfg: {},

    /**
     * @cfg {Boolean} showCount
     * True to show small number in button indicating the number of items in menu.
     * Defaults to false.
     */
    showCount: false,

@@ -39,14 +32,7 @@ Ext.define('Docs.view.HoverMenuButton', {
             * @event click
             * Fired when button clicked.
             */
            "click",
            /**
             * @event closeclick
             * Fired when close link in menu clicked.
             * @param {String} name  Name of the class and or member that was closed.
             * For example "Ext.Ajax" or "Ext.Ajax-method-request".
             */
            "closeclick"
            "click"
        );

        // Append links count to button text, update it when store filtered
@@ -58,9 +44,9 @@ Ext.define('Docs.view.HoverMenuButton', {
            }, this);
        }

        this.menu = Ext.create('Docs.view.HoverMenu', Ext.apply({
        this.menu = Ext.create('Docs.view.HoverMenu', {
            store: this.store
        }, this.menuCfg));
        });

        this.callParent(arguments);
    },
@@ -103,11 +89,7 @@ Ext.define('Docs.view.HoverMenuButton', {
        this.menu.hide();

        this.menu.getEl().addListener('click', function(e) {
            if (e.getTarget(".close")) {
                this.fireEvent("closeclick", e.getTarget().rel);
            } else {
            this.menu.hide();
            }
            e.preventDefault();
        }, this);

+7 −8
Original line number Diff line number Diff line
@@ -180,21 +180,20 @@ Ext.define('Docs.view.cls.Toolbar', {
    // creates store tha holds link records
    createStore: function(records) {
        var store = Ext.create('Ext.data.Store', {
            fields: ['id', 'cls', 'url', 'label', 'inherited', 'accessor', 'meta']
            fields: ['id', 'url', 'label', 'inherited', 'accessor', 'meta']
        });
        store.add(records);
        return store;
    },

    // Creates link object referencing a class (and optionally a class member)
    // Creates link object referencing a class member
    createLinkRecord: function(cls, member) {
        return {
            cls: cls,
            url: member ? (cls + "-" + member.id) : cls,
            label: member ? ((member.tagname === "method" && member.name === "constructor") ? "new "+cls : member.name) : cls,
            inherited: member ? member.owner !== cls : false,
            accessor: member ? member.tagname === "method" && this.accessors.hasOwnProperty(member.name) : false,
            meta: member ? member.meta : {}
            url: cls + "-" + member.id,
            label: (member.tagname === "method" && member.name === "constructor") ? "new "+cls : member.name,
            inherited: member.owner !== cls,
            accessor: member.tagname === "method" && this.accessors.hasOwnProperty(member.name),
            meta: member.meta
        };
    },

+0 −12
Original line number Diff line number Diff line
@@ -37,18 +37,6 @@
    &:hover {
      color: $docs-link-color;
      text-decoration: underline; }
    &.close {
      position: absolute;
      width: 12px;
      height: 12px;
      @include opacity(0.5);
      background: url(../images/x12.png) no-repeat;
      text-indent: -9999px;
      padding: 3px 0 0 0;
      right: 0;
      top: 3px;
      &:hover {
        @include opacity(1); } }
    span.signature {
      font-size: 0.6em;
      text-transform: uppercase;