Skip to content

Commit

Permalink
DOC-458 SearchButton documentation revision (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeaudoincoveo authored and olamothe committed Feb 8, 2017
1 parent b71456f commit 9b58372
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions src/ui/SearchButton/SearchButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ export interface ISearchButtonOptions {
}

/**
* A component that allows user to trigger a query by clicking on it.<br/>
* This component will instantiate on an element and add a search icon.<br/>
* It will also sends an analytics event to the Coveo platform when clicked.
* The SearchButton component renders a search icon that the end user can click to trigger a new query.
*
* See also the {@link Searchbox} component, which can automatically instantiate a SearchButton component along with a
* {@link Querybox} component or an {@link Omnibox} component.
*/
export class SearchButton extends Component {
static ID = 'SearchButton';

static options: ISearchButtonOptions = {};

/**
* Create a new SearchButton on the given element with the given options.
* Bind a click event on the element
* Adds a search icon on the element
* @param element
* @param options
* @param bindings
* Creates a new SearchButton. Binds a `click` event on the element. Adds a search icon on the element.
* @param element The HTMLElement on which to instantiate the component.
* @param options The options for the SearchButton component.
* @param bindings The bindings that the component requires to function normally. If not set, these will be
* automatically resolved (with a slower execution time).
*/
constructor(public element: HTMLElement, public options?: ISearchButtonOptions, bindings?: IComponentBindings) {
super(element, SearchButton.ID, bindings);
Expand All @@ -38,7 +38,8 @@ export class SearchButton extends Component {
}

/**
* Trigger the click handler
* Triggers the `click` event handler, which logs a `searchboxSubmit` event in the usage analytics and executes a
* query.
*/
public click() {
this.handleClick();
Expand Down

0 comments on commit 9b58372

Please sign in to comment.