Commit 37e91df2 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Add pri/sta/pro/... labels to search dropdown.

This way one can easily differenciate between static, deprecated, and
other types of items in search results.
parent 228b52e8
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -43,8 +43,7 @@ module JsDuck
        :type => :class,
        :icon => :subclass,
        :id => cls.full_name,
        :private => cls[:private],
        :removed => cls[:meta][:removed],
        :meta => cls[:meta],
        :sort => 0,
      }
    end
@@ -57,8 +56,7 @@ module JsDuck
        :type => :class,
        :icon => :class,
        :id => cls.full_name,
        :private => cls[:private],
        :removed => cls[:meta][:removed],
        :meta => cls[:meta],
        :sort => 1,
      }
    end
@@ -71,8 +69,7 @@ module JsDuck
        :type => :class,
        :icon => :subclass,
        :id => cls.full_name,
        :private => cls[:private],
        :removed => cls[:meta][:removed],
        :meta => cls[:meta],
        :sort => 2,
      }
    end
@@ -85,8 +82,7 @@ module JsDuck
        :type => :member,
        :icon => member[:tagname],
        :id => cls.full_name + "-" + member[:id],
        :private => member[:private],
        :removed => member[:meta][:removed],
        :meta => member[:meta],
        :sort => 3,
      }
    end
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@
Ext.define('Docs.store.Search', {
    extend: 'Ext.data.Store',

    fields: ['cls', 'member', 'type', 'icon', 'id', 'private', 'sort'],
    fields: ['cls', 'member', 'type', 'icon', 'id', 'meta', 'sort'],
    proxy: {
        type: 'memory',
        reader: {
+9 −3
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ Ext.define('Docs.view.search.Dropdown', {
            '<tpl for=".">',
                '<div class="item">',
                    '<div class="icon icon-{icon}"></div>',
                    '<div class="title {[this.getCls(values)]}">{member}</div>',
                    '<div class="meta">{[this.getMetaTags(values.meta)]}</div>',
                    '<div class="title {[this.getCls(values.meta)]}">{member}</div>',
                    '<div class="class">{cls}</div>',
                '</div>',
            '</tpl>',
@@ -54,8 +55,13 @@ Ext.define('Docs.view.search.Dropdown', {
                '<a href="#" class="next">&gt;</a>',
            '</div>',
            {
                getCls: function(values) {
                    return values["private"] ? "private" : (values.removed ? "removed" : "");
                getCls: function(meta) {
                    return meta["private"] ? "private" : (meta.removed ? "removed" : "");
                },
                getMetaTags: function(meta) {
                    return Ext.Array.map(Docs.data.signatures, function(s) {
                        return meta[s.key] ? '<span class="signature '+s.key+'">'+(s["short"])+'</span>' : '';
                    }).join(' ');
                },
                getTotal: Ext.bind(this.getTotal, this),
                getStart: Ext.bind(this.getStart, this),
+6 −0
Original line number Diff line number Diff line
@@ -108,6 +108,12 @@
    height: 18px; }
  @include icons;

  .meta {
    position: absolute;
    top: 6px;
    right: 4px;
    @include mini-signature; }

  .item.x-item-selected {
    background-color: #ffffaa; }
  .item.x-view-over {
+1 −7
Original line number Diff line number Diff line
@@ -36,13 +36,7 @@
    &:hover {
      color: $docs-link-color;
      text-decoration: underline; }
    span.signature {
      font-size: 0.6em;
      text-transform: uppercase;
      font-weight: bold;
      padding: 0 0.5em;
      @include border-radius(2px);
      @include signature-colors; } } }
    @include mini-signature; } }

.hover-menu a {
  font-family: Helvetica, Arial, clean, sans-serif;
Loading