Class: CitationModalView

CitationModalView()

The CitationModalView shows a citation information displayed as a modal, along with a copy citation button. This view will eventually allow switching between different citation styles.

Constructor

new CitationModalView()

Source:

Extends

  • Backbone.View

Members

className :string

Classes to add to the modal
Type:
  • string
Source:

events :Object

The events this view will listen for. See https://backbonejs.org/#View-events
Type:
  • Object
Source:

icons :Object

The font awesome icons to use for this view
Type:
  • Object
Properties:
Name Type Description
title string The icon to use in the modal title
button string The icon to use in the copy citation button
buttonSuccess string The icon to use in the copy citation button when the citation has been copied
Source:

ids :Object

The ids to use for this view
Type:
  • Object
Properties:
Name Type Description
citationContainer string The id to use for the citation container
copyButton string The id to use for the copy citation button
Source:

innerButtonTemplate :Underscore.Template

The underscore template for the copy citation button. This will render the inner HTML for the button, which will be added to the template and also used to update the button when the citation is copied.
Type:
  • Underscore.Template
Source:

model :CitationModel

The citation model that contains the citation data
Type:
Source:

style :string

The citation style to use
Type:
  • string
Default Value:
  • "apa"
Source:
See:

template :Underscore.Template

The underscore template for the main part of this view (modal)
Type:
  • Underscore.Template
Source:

text :Object

The text to use for this view
Type:
  • Object
Properties:
Name Type Description
title string The title to use in the modal
copyButton string The text to use in the copy citation button
copySuccess string The text to use in the copy citation button when the citation has been copied
Source:

Methods

initialize(options)

Initialize a new CitationModalView
Parameters:
Name Type Description
options Object A literal object with options to pass to the view
Properties
Name Type Description
model CitationModel The citation model, or other model accepted by the CitationView, that contains the citation data
style string The citation style to use. This will be passed to the CitationView
Source:

insertCitation()

Insert the citation view into the modal
Source:

listenForCopy()

Listen for the copy button to be clicked, and copy the citation to the clipboard
Source:

onClose()

Cleans up and removes all artifacts created for view
Source:

render()

Render the view
Source:

renderView() → {CitationModalView}

Render the view
Source:
Returns:
- Returns this view
Type
CitationModalView

show()

Make the modal visible
Source:

teardown()

Remove the modal from the DOM
Source: