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

Use icons mixin at search dropdown.

Instead of using separate image files for each of the icons there.

This allows us to get rid of class-sm.png file.

Also adjust the config icon offset by a pixel so it's not clipped.
parent 6afed816
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@ module JsDuck
      return {
        :cls => cls.full_name,
        :member => cls.short_name,
        :type => :cls,
        :type => :class,
        :xtypes => cls[:xtypes]
      }
    end
+5 −5
Original line number Diff line number Diff line
@@ -117,7 +117,7 @@ Ext.define('Docs.controller.Search', {
    // loads class/method corrseponding to the record
    loadRecord: function(record) {
        var name = record.get("cls");
        if (record.get("type") !== 'cls') {
        if (record.get("type") !== 'class') {
            name += '-' + record.get("id");
        }
        Docs.App.getController('Classes').loadClass("#!/api/"+name);
@@ -165,22 +165,22 @@ Ext.define('Docs.controller.Search', {
        Ext.Array.forEach(Docs.data.search, function(r) {
            // when search text has "." in it, search from the full name (e.g. "Ext.Component.focus")
            // Otherwise search from just the member name (e.g. "focus" or "Component")
            var name = hasDot ? r.cls + (r.type === "cls" ? "" : "." + r.member) : r.member;
            var name = hasDot ? r.cls + (r.type === "class" ? "" : "." + r.member) : r.member;

            if (r.xtypes && this.matchXType(r.xtypes, reFull)) {
                results[xFull].push(r);
            }
            else if (reFull.test(name)) {
                results[r.type === "cls" ? clsFull : mFull].push(r);
                results[r.type === "class" ? clsFull : mFull].push(r);
            }
            else if (r.xtypes && this.matchXType(r.xtypes, reBeg)) {
                results[xBeg].push(r);
            }
            else if (reBeg.test(name)) {
                results[r.type === "cls" ? clsBeg : mBeg].push(r);
                results[r.type === "class" ? clsBeg : mBeg].push(r);
            }
            else if (reMid.test(name)) {
                results[r.type === "cls" ? clsMid : mMid].push(r);
                results[r.type === "class" ? clsMid : mMid].push(r);
            }
        }, this);

+2 −1
Original line number Diff line number Diff line
@@ -42,7 +42,8 @@ Ext.define('Docs.view.search.Dropdown', {

        this.tpl = new Ext.XTemplate(
            '<tpl for=".">',
                '<div class="item {type}">',
                '<div class="item">',
                    '<div class="icon icon-{type}"></div>',
                    '<div class="title">{member}</div>',
                    '<div class="class">{cls}</div>',
                '</div>',
−2.03 KiB
Loading image diff...
+12 −10
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@
  z-index: 5;

  .item, .footer {
    position: relative;
    display: block;
    cursor: pointer;
    overflow: hidden;
@@ -91,16 +92,17 @@
      font-size: 0.85em;
      overflow: hidden;
      text-overflow: ellipsis; } }
  .item.cfg {
    background: url(../images/configs.png) no-repeat 0 3px; }
  .item.property {
    background: url(../images/properties.png) no-repeat 3px 8px; }
  .item.method {
    background: url(../images/methods.png) no-repeat 3px 5px; }
  .item.event {
    background: url(../images/events.png) no-repeat 4px 0px; }
  .item.cls {
    background: url(../images/class-sm.png) no-repeat 3px 5px; }

  // 18x18 div to just hold the icon
  .icon {
    position: absolute;
    float: left;
    top: 6px;
    left: 4px;
    width: 18px;
    height: 18px; }
  @include icons;

  .item.x-item-selected {
    background-color: #ffffaa; }
  .item.x-view-over {
Loading