Class jabberwerx.ui.RosterView.Grouping
Extends
jabberwerx.ui.JWView.
View over a grouping of entities in a RosterView.
This class provides the following events:
Constructor Attributes | Constructor Name and Description |
---|---|
jabberwerx.ui.RosterView.Grouping(roster, name, mode)
Creates a new Grouping with the given owning roster, grouping name, and mode. |
Field Attributes | Field Name and Description |
---|---|
The current mode for this Grouping. |
|
The RosterView owning this Grouping. |
- Fields borrowed from class jabberwerx.ui.JWView:
- jq
Method Attributes | Method Name and Description |
---|---|
collapse()
Collapses this grouping. |
|
createDOM(doc)
Creates DOM for this Grouping. |
|
expand()
Expands this grouping. |
|
Finish entity view hydration. |
|
toggle()
This method toggles between expanded and collapsed. |
|
update()
Updates this Grouping's view. |
- Methods borrowed from class jabberwerx.ui.JWView:
- destroy, destroyDOM, dimensions, height, hide, parent, persistOptions, remove, render, restoreDOM, restoreRender, restoreUpdate, shouldBeSavedWithGraph, show, wasUnserialized, width, willBeSerialized
- Methods borrowed from class jabberwerx.JWModel:
- applyEvent, event
- Methods borrowed from class jabberwerx.JWBase:
- getClassName, init, invocation, shouldBeSerializedInline, toString
Creates a new Grouping with the given owning roster, grouping name, and mode.
NOTE: This type should not be created directly. Instead it is creating in RosterView to visually group entities.
- Parameters:
- {jabberwerx.ui.RosterView} roster
- The owning roster
- {String} name
- The grouping name ("" for the default)
- {Number} mode
- The grouping mode (one of jabberwerx.ui.RosterView.groupmode_single, jabberwerx.ui.RosterView.groupmode_collapsed, or jabberwerx.ui.RosterView.groupmode_expanded)
The current mode for this Grouping. This value is one of the following:
- jabberwerx.ui.RosterView.groupmode_single
- jabberwerx.ui.RosterView.groupmode_collapsed
- jabberwerx.ui.RosterView.groupmode_expanded
NOTE: This propery should not be changed directly. Instead it is changed via #collapse, #expand, or #single.
The RosterView owning this Grouping.
Collapses this grouping. This method will make hidden all of the displayable entities it has, if previously expanded.
NOTE: This method does nothing if the current mode is jabberwerx.ui.RosterView.groupmode_collapsed or jabberwerx.ui.RosterView.groupmode_single.
- Returns:
- {Boolean} true if the grouping was collapsed.
Creates DOM for this Grouping. This method generates the following structure:
<div class='jabberwerx group section'> <div class='group title'> <span class='extrainfo'/> <a href='#' <span class='displayname'/> </a> </div> <div class='group items'> <!-- ContactPresenceViews are inserted here --> </div> </div>
- Parameters:
- {Document} doc
- The owning document
- Returns:
- {Element} The created DOM
Expands this grouping. This method will make visible all of the displayable entities it has, if previously collapsed.
NOTE: This method does nothing if the current mode is jabberwerx.ui.RosterView.groupmode_expanded or jabberwerx.ui.RosterView.groupmode_single.
- Returns:
- {Boolean} true if the grouping was expanded
Finish entity view hydration.
This method toggles between expanded and collapsed.
NOTE: This method does nothing if the current mode is jabberwerx.ui.RosterView.groupmode_single.
- Returns:
- {Boolean} true if the grouping was collapsed or expanded.
Updates this Grouping's view. This method does the following:
- Removes the "expanded" and "collapsed" class styles to "div.group.title"
- Sets the "span.displayname" text to #name (or jabberwerx.ui.RosterView#getDefaultGroupingName if "")
- Sets the "span.extraninfo" text to "<visible>/<total>" (where <visible> is the number of visible entities, and <total> is the total number of entities in this grouping)
- If #mode is jabberwerx.ui.RosterView.groupmode_single, hides the "div.group.title" and shows the "div.group.items"
- If #mode is jabberwerx.ui.RosterView.groupmode_collapsed, adds the "collapsed" class style to "div.group.title" and hides the "div.group.items"
- If #mode is jabberwerx.ui.RosterView.groupmode_expanded, adds the "expanded" class style to "div.group.title" and shows the "div.group.items"
- Walks the entities, calling jabberwerx.ui.ContactPresenceView#update for each, and setting to visible or hidden as dictated by the RosterView's filters (if any).
- Returns:
- {Boolean} true if this display is updatable