Constructor
new EMLMissingValueCodeView()
- Since:
- Source:
Extends
Members
The HTML for the remove button
Type:
- Source:
className :string
The className to add to the view container
Type:
- Source:
classes :Object
The classes to add to the HTML elements in this view
Type:
Properties:
Name |
Type |
Description |
removeButton |
string
|
The class to add to the remove button |
- Source:
isNew :boolean
Set this to true if this row is for a blank input row. This will
prevent the view from rendering a remove button until the user starts
typing.
Type:
- Default Value:
- Source:
text :Object
User-facing text strings that will be displayed in this view.
Type:
Properties:
Name |
Type |
Description |
codePlaceholder |
string
|
The placeholder text for the code
input |
codeExplanationPlaceholder |
string
|
The placeholder text
for the code explanation input |
removeButton |
string
|
The text for the remove button |
- Source:
type :string
The type of View this is
Type:
- Source:
Methods
handleTyping(e)
When a user types anything into any input, update the model and show
the remove button if it was not yet rendered.
Parameters:
Name |
Type |
Description |
e |
Event
|
The event that was triggered by the user |
- Source:
initialize(options)
Creates a new EMLMissingValueCodeView
Parameters:
Name |
Type |
Description |
options |
Object
|
A literal object with options to pass to the
view
Properties
Name |
Type |
Attributes |
Description |
model |
EMLAttribute
|
<optional>
|
The EMLMissingValueCode model
to render. If no model is provided, an empty model will be created. |
|
- Source:
previewRemove()
When the button is hovered over, indicate visually that the row will
be removed when the button is clicked
- Source:
removeListeners()
Remove listeners from the view's DOM elements
- Source:
removeSelf()
Remove this view from the DOM and collection and remove any event
listeners
- Source:
Renders this view
- Source:
Returns:
A reference to this view
-
Type
-
EMLMissingValueCodeView
Create and insert the input element for one of the model's attributes.
This will add the input to the end of the view's element.
Parameters:
Name |
Type |
Description |
attr |
string
|
The name of the attribute to create an input
for, either "code" or "codeExplanation" |
- Source:
Returns:
The input element
-
Type
-
Element
Create and insert the remove button
- Source:
Returns:
The remove button
-
Type
-
Element
setListeners()
Set listeners on the view's DOM elements
- Source:
undoPreviewRemove()
When the button is no longer hovered over, undo the visual indication
that the row will be removed when the button is clicked
- Source:
Update the model with the value in the input
Parameters:
Name |
Type |
Description |
attr |
string
|
The name of the attribute to update, either
"code" or "codeExplanation" |
- Source:
Returns:
The new value
-
Type
-
string