Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Document title typeahead results #744

@terba

Description

@terba

The results for the document title typeahead search are most of the time not what I was expecting. So I changed the sort order to descending, the sort column to 3 and the limit to 10 in DocumentEdit.js. It is much better now, as it offers the latest documents matching the typed text.

  /**
   * Returns a promise for typeahead title.
   */
  $scope.getTitleTypeahead = function($viewValue) {
    var deferred = $q.defer();
    Restangular.one('document/list')
    .get({
      limit: 10,
      sort_column: 3,
      asc: false,
      search: $viewValue
    }).then(function(data) {
      deferred.resolve(_.uniq(_.pluck(data.documents, 'title'), true));
    });
    return deferred.promise;
  };

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions