Constructor
new PortalView()
- Source:
Extends
Members
The currently active section view
Type:
- Source:
activeSectionLabel :string
The currently active section label. e.g. Data, Metrics, Settings, etc.
Type:
- Source:
displaySectionInUrl :boolean
Flag to add section name to URL. Enabled by default.
Type:
- Source:
A jQuery selection for the element that will contain the Edit button.
Type:
- Since:
- Source:
el :string
The Portal element
Type:
- Source:
events :Object
The events this view will listen to and the associated function to call.
Type:
- Source:
label :string
The unique short name of the portal
Type:
- Source:
A reference to the Portal Logos View that displays the logos of this portal.
Type:
- Source:
model :Portal
A Portal Model is associated with this view and gets created during render()
Type:
- Source:
portalId :string
The seriesId of the portal document
Type:
- Source:
sectionEls :string
A jQuery selector for the section elements
Type:
- Source:
sectionLinkContainer :string
A jQuery selector for the element that a single section link will be inserted into
Type:
- Source:
sectionLinks :string
A jQuery selector for the elements that are links to the individual sections
Type:
- Source:
sectionNames :Array
The names of all sections in this portal editor
Type:
- Source:
subviews :Array
The subviews contained within this view to be removed with onClose
Type:
- Source:
type :string
The type of View this is
Type:
- Source:
userModel :User
A User Model is associated with this view for rendering node/user views
Type:
- Source:
Methods
addSection(sectionModel)
Creates a PortalSectionView to display the content in the given portal
section. Also creates a navigation link to the section.
Parameters:
- Source:
addSectionLink(sectionView)
Add a link to a section of this portal page
Parameters:
- Source:
addTheming()
Checks the portal model for theme or layout options. If there are any, and if
they are supported, then add the associated CSS.
- Source:
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 |
- Source:
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 |
- Source:
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 |
- Source:
Returns:
The unique label string
-
Type
-
string
handleNotFound()
Handles the case where the PortalModel is fetched and nothing is found.
- Source:
This function is called whenever the window is scrolled.
- Source:
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 |
- Source:
initialize()
Is executed when a new PortalView is created
- Source:
isNode(username)
Checks if the label is a repository
Parameters:
Name |
Type |
Description |
username |
string
|
The portal label or the member node repository identifier |
- Source:
onClose()
This function is called when the app navigates away from this view.
Any clean-up or housekeeping happens at this time.
- Source:
Initial render of the PortalView
- Source:
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
- Source:
renderAsPortal()
Entry point for portal rendering
- Source:
renderPortal()
Render the Portal view
- Source:
showError(model, reponse)
Show an error message in this view
Parameters:
Name |
Type |
Description |
model |
SolrResult
|
|
reponse |
XMLHttpRequest.response
|
string
|
|
- Source:
showNotFound()
If the given portal doesn't exist, display a Not Found message.
- Source:
switchSection(portalSectionViewopt)
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 |
portalSectionView |
PortalSectionView
|
<optional>
|
The section view to switch to. If not given, defaults to the activeSection set on the view. |
- Source:
toggleSectionLinks()
toggleSectionLinks - show or hide the section links nav. Used for
mobile/small screens only.
- Source:
updatePath(showSectionLabelopt, retainSearchQueryopt)
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 |
retainSearchQuery |
boolean
|
<optional>
|
Whether to keep the search query
params during a path change. These should be kept when the page is
loading initially. |
- Source:
updateSectionNames()
Gets a list of section names from tab elements and updates the
sectionNames attribute on this view.
- Source: