Class: SearchResultView

SearchResultView()

A single result item view

Screenshot

Constructor

new SearchResultView()

Source:

Extends

  • Backbone.View

Members

className :string

The HTML classes to use for this view's element
Type:
  • string
Source:

events :Object

The events this view will listen to and the associated function to call.
Type:
  • Object
Source:

loadingTemplate :string

The HTML template to use when showing that a result item is loading
Type:
  • string
Source:

metricStatTemplate :underscore.template

The HTML template to use for the metrics statics
Type:
  • underscore.template
Source:

tagName :string

The tag name for the view's element
Type:
  • string
Source:

template :underscore.template

The HTML template to use for this view's main element
Type:
  • underscore.template
Source:

Methods

clear()

Remove the item, destroy the model from *localStorage* and delete its view.
Source:

download(e)

Downloads the data package for a result item that was clicked on
Parameters:
Name Type Description
e * The click event
Source:

getOpenURLCOinS() → {HTMLSpanElement}

Create ContextObjects in Spans (COinS) for the item. COinS is a method to embed bibliographic metadata in the HTML code of web pages. This allows bibliographic software to publish machine-readable bibliographic items and client reference management software to retrieve bibliographic metadata. (from wikipedia)
Source:
Returns:
- The span element containing the COinS data
Type
HTMLSpanElement

initialize(options)

Initialize the view. The SearchResultView listens for changes to its model, re-rendering. Since there's a one-to-one correspondence between a **SolrResult** and a **SearchResultView** in this app, we set a direct reference on the model for convenience.
Parameters:
Name Type Description
options *
Source:

loading()

Show the loading view
Source:

onClose()

Functions to perform when the view is closed
Source:

render() → {SearchResultView}

Render or re-render the result item.
Source:
Returns:
Returns this view
Type
SearchResultView

routeToMetadata(e)

Navigates the app to the metadata page for a result item that was clicked on
Parameters:
Name Type Description
e * The click event
Source:

toggleSelected()

Toggles the selected state of the model
Source:

toggleShowOnMap(e)

Toggles the showOnMap state of the model when the user hovers over or leaves the map marker icon
Parameters:
Name Type Description
e Event The mouseover or mouseout event
Source: