Extends
- Backbone.View
Members
activeSection :PortalSectionView
The currently active section view
Type:
activeSectionLabel :string
The currently active section label. e.g. Data, Metrics, Settings, etc.
Type:
- string
displaySectionInUrl :boolean
Flag to add section name to URL. Enabled by default.
Type:
- boolean
editButtonContainer :string
A jQuery selection for the element that will contain the Edit button.
Type:
- string
- Since:
- 2.14.0
- Source:
el :string
The Portal element
Type:
- string
events :Object
The events this view will listen to and the associated function to call.
Type:
- Object
label :string
The unique short name of the portal
Type:
- string
model :Portal
A Portal Model is associated with this view and gets created during render()
Type:
- Portal
portalId :string
The seriesId of the portal document
Type:
- string
sectionEls :string
A jQuery selector for the section elements
Type:
- string
sectionLinkContainer :string
A jQuery selector for the element that a single section link will be inserted into
Type:
- string
sectionLinks :string
A jQuery selector for the elements that are links to the individual sections
Type:
- string
sectionNames :Array
The names of all sections in this portal editor
Type:
- Array
subviews :Array
The subviews contained within this view to be removed with onClose
Type:
- Array
type :string
The type of View this is
Type:
- string
userModel :User
A User Model is associated with this view for rendering node/user views
Type:
- User
Methods
addSection(sectionModel)
Creates a PortalSectionView to display the content in the given portal
section. Also creates a navigation link to the section.
Parameters:
Name | Type | Description |
---|---|---|
sectionModel |
PortalSectionModel | The section to render in this view |
addSectionLink(sectionView)
Add a link to a section of this portal page
Parameters:
Name | Type | Description |
---|---|---|
sectionView |
PortalSectionView | The view to add a link to |
addVizSection(sectionModel)
Creates a PortalSectionView to display the content in the given portal
section. Also creates a navigation link to the section.
Parameters:
Name | Type | Description |
---|---|---|
sectionModel |
PortalVizSectionModel | The visualization section to render in this view |
getSectionByLabel(label) → {PortalSectionView|false}
Returns the section view that has a label matching the one given.
Parameters:
Name | Type | Description |
---|---|---|
label |
string | The label for the section |
Returns:
- Returns false if a matching section view isn't found
- Type
- PortalSectionView | false
getUniqueSectionLabel(sectionModel) → {string}
Creates and returns a unique label for the given section. This label is just used in the view,
because portal sections can have duplicate labels. But unique labels need to be used for navigation in the view.
Parameters:
Name | Type | Description |
---|---|---|
sectionModel |
PortEditorSection | The section for which to create a unique label |
Returns:
The unique label string
- Type
- string
handleNotFound()
Handles the case where the PortalModel is fetched and nothing is found.
handleScroll()
This function is called whenever the window is scrolled.
handleSwitchSection(e)
When a section link has been clicked, switch to that section
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | The click event on the section link |
initialize()
Is executed when a new PortalView is created
onClose()
This function is called when the app navigates away from this view.
Any clean-up or housekeeping happens at this time.
render() → {PortalView}
Initial render of the PortalView
Returns:
Returns itself for easy function stacking in the app
- Type
- PortalView
renderAsNode()
Entry point for a repository portal view
At this point we know for sure that a given label/username is a repository user
renderAsPortal()
Entry point for portal rendering
renderPortal()
Render the Portal view
showError(model, reponse)
Show an error message in this view
Parameters:
Name | Type | Description |
---|---|---|
model |
SolrResult | |
reponse |
XMLHttpRequest.response | string |
showNotFound()
If the given portal doesn't exist, display a Not Found message.
switchSection(sectionViewopt)
Manually switch to a section subview by making the tab and tab panel active.
Navigation between sections is usually handled automatically by the Bootstrap
library, but a manual switch may be necessary sometimes
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sectionView |
PortalSectionView |
<optional> |
The section view to switch to. If not given, defaults to the activeSection set on the view. |
toggleSectionLinks()
toggleSectionLinks - show or hide the section links nav. Used for
mobile/small screens only.
updatePath(showSectionLabelopt)
Update the window location path with the active section name
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
showSectionLabel |
boolean |
<optional> |
If true, the section label will be added to the path |
updateSectionNames()
Gets a list of section names from tab elements and updates the
sectionNames attribute on this view.