Sha256: e8f45299469d3a64eb8a5fb3193c9929a4328612ffb5f17ac2d75f257ada2e50

Contents?: true

Size: 906 Bytes

Versions: 1

Compression:

Stored size: 906 Bytes

Contents

Ext.ns('Rwiki.Search');

Rwiki.Search.Window = Ext.extend(Ext.Window, {

  constructor: function() {
    var search = new Ext.form.ComboBox({
      store: this._getDataStore(),
      tpl: this._getResultTemplate(),

      minChars: 2,
      displayField: 'title',
      typeAhead: false,
      loadingText: 'Searching...',
      hideTrigger: true,
      itemSelector: 'div.search-item',
      listeners: {
        scope: this,
        select: this.onSelectResult
      }
    });

    Ext.apply(this, {
      maximizable: false,
      modal: true,
      width: 600,
      layout: 'fit',
      plain: true,
      bodyStyle: 'padding: 5px;',
      items: [search],
      defaultButton: search
    });

    Rwiki.Search.Window.superclass.constructor.apply(this, arguments);
  },

  onSelectResult: function(combo, record) {
    var path = record.data.path;
    Rwiki.openPage(path);

    this.close();
  }
});

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rwiki-0.2.5 public/javascripts/Rwiki/Search/Window.js