Constructor
new PortEditorMdSectionView()
- Source:
Extends
Members
attributes :object
The HTML attributes to set on this view's element
Type:
- Source:
className :string
The HTML classes to use for this view's element
Type:
- Overrides:
- Source:
A reference to the PortalEditorView
Type:
- Overrides:
- Source:
events :Object
The events this view will listen to and the associated function to call.
Type:
- Overrides:
- Source:
imageUploaderContainer :string
A jQuery selector for the element that will contain the ImageUploader view
Type:
- Source:
introEl :string
A jQuery selector for the element that will contain the markdown section
introduction text
Type:
- Source:
markdownEditorContainer :string
A jQuery selector for the element that will contain the markdown editor
Type:
- Source:
model :PortalSection
The PortalSectionModel that is being edited
Type:
- Overrides:
- Source:
sectionType :string
The type of section view this is
Type:
- Source:
Information about each of the section types available to a user. Note that the key (e.g. "freeform") is used to ID the UI selection element.
Type:
- Inherited From:
- Source:
sectionsOptionsContainer :string
A jQuery selector for the element that the section option buttons should be inserted into
Type:
- Inherited From:
- Source:
tagName :string
The HTML tag name for this view's element
Type:
- Inherited From:
- Source:
template :Underscore.Template
References to templates for this view. HTML files are converted to Underscore.js templates
Type:
- Overrides:
- Source:
titleEl :string
A jQuery selector for the element that will contain the markdown section
title text
Type:
- Source:
type :string
The type of View this is
Type:
- Overrides:
- Source:
uniqueSectionLabel :string
The unique label for this Section. It most likely matches the label on the model, but
may include a number after if more than one section has the same name.
Type:
- Inherited From:
- Source:
Methods
addNewSection(e)
Gets the section type to add, and triggers an event so the rest of the app will add a new section
Parameters:
Name |
Type |
Description |
e |
Event
|
The element that was clicked that represents the section option |
- Inherited From:
- Source:
disableSectionOption(sectionType)
Adds styling and content to a section option element to indicate that the user already added the maximum allowable number of this section type (i.e. it's disabled).
Parameters:
Name |
Type |
Description |
sectionType |
string
|
The section name. This is the same string used as the key in sectionsOptions (e.g. "freeform"). |
- Inherited From:
- Source:
enableSectionOption(sectionType)
Adds styling and content to a section option element to indicate that the user is able to add more of this section type (i.e. it's not disabled).
Parameters:
Name |
Type |
Description |
sectionType |
string
|
The section name. This is the same string used as the key in sectionsOptions (e.g. "freeform"). |
- Inherited From:
- Source:
initialize(options)
Is executed when a new PortEditorMdSectionView is created
Parameters:
Name |
Type |
Description |
options |
Object
|
A literal object with options to pass to the view |
- Overrides:
- Source:
render()
Renders this view
- Overrides:
- Source:
resizeTextarea(textareas)
resizeTextarea - Set the height of a textarea element based on its
scrollHeight.
Parameters:
Name |
Type |
Description |
textareas |
jQuery
|
The textarea element or elements to be resized. |
- Source:
showValidation()
showValidation - Display validation errors if any are retuned by the PortalSection model
- Source:
toggleDisableSectionOption(sectionType)
Checks whether a section type is available to a user to add, then calls functions that change content and styling to indicate the availability to the user.
Parameters:
Name |
Type |
Description |
sectionType |
string
|
The section name. This is the same string used as the key in sectionsOptions (e.g. "freeform"). |
- Inherited From:
- Source: