new PortEditorSettingsView()
- Source:
Extends
Members
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:
id
The id attribute of the view element
- Source:
model :Portal
The PortalModel 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
References to templates for this view. HTML files are converted to Underscore.js templates
- Overrides:
- Source:
type :string
The type of View this is
Type:
- Overrides:
- Source:
uniqueSectionLabel :string
The display name for this Section
Type:
- Overrides:
- 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:
cancelChangeLabel()
Cancels changing the portal label
- Source:
changeLabel()
Makes the portal label editable whenever the `change url` button is clicked
- 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)
Creates a new PortEditorSettingsView
Parameters:
| Name |
Type |
Description |
options |
Object
|
A literal object with options to pass to the view |
- Overrides:
- Source:
okChangeLabel()
Shows the portal label as saved
- Source:
removeLabelValidation(e)
Removes help text and css formatting that indicates error or success after label/URL validation.
Parameters:
| Name |
Type |
Description |
e |
Event
|
The keyup or focusout event |
- Source:
render()
Renders this view
- Overrides:
- Source:
showLabelValidation(e)
Initiates validatation of the newly inputed label (a URL component).
Listens for a response from the model, then displays help text based on
whether the new label was valid or not.
Parameters:
| Name |
Type |
Description |
e |
Event
|
The focusout event |
- Source:
showLabelValidationError(e)
showLabelValidationError - add css formatting and hide OK button when there are errors in label validation.
Parameters:
| Name |
Type |
Description |
e |
Event
|
The keyup or focusout event |
- 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:
Type Definitions
sectionOption
Information
about a section type that can be added to a portal
Type:
Properties:
| Name |
Type |
Description |
title |
string
|
The name of the section type to be displayed
to the user |
description |
string
|
A brief description of the section
type, to be displayed to the user |
limiter |
string
|
number
|
The limiter is used to determine
whether the user is allowed to add more of this section type. If
limiter is a number, then it's used as the maximum number of the given
sections allowed (currently this only applies to 'freeform'/markdown
sections). If limiter is a string, it should be the name of the 'hide'
option in the project model (e.g. hideMetrics for the metrics view). In
this case, it's assumed that only one of the given page type is
allowed. |
svg |
string
|
SVG that illustrates the section type. SVG
elements should use classes to define fill colors that are not
greyscale, so that they may be greyed-out to indicate that a section
type is unavailable. SVG elements that use theme colors should use the
classes 'theme-primary-fill', 'theme-secondary-fill', and
'theme-accent-fill'. |
- Inherited From:
- Source: