Class Index | Minimal

Classes


Class jabberwerx.ui.TabbedView.Tab


Extends jabberwerx.ui.JWView.

View of the tab control in a TabbedView. The tab is what selects the contents to display in a TabbedView.

NOTE: This type should not be created directly. Instead, it is created via jabberwerx.ui.TabbedView#addTab.

This class provides the following events:

Class Summary
Constructor Attributes Constructor Name and Description
 
jabberwerx.ui.TabbedView.Tab(tabview, content, id)

Creates a new Tab with the given tabview, content, and identifier.

Field Summary
Field Attributes Field Name and Description
 

The content this tab refers to.

 
id

The identifier of this tab

 

The owning TabbedView.

Fields borrowed from class jabberwerx.ui.JWView:
jq
Method Summary
Method Attributes Method Name and Description
 

Activates this tab within its owning TabbedView.

 

Cancels the attention request.

 
createDOM(doc)

Creates this Tab's DOM representation.

 

Destroys this Tab.

 

Destroys this view's DOM.

 
hide()

Makes this tab's header (and contents) hidden.

 

Determines if this Tab is active.

 
label(label)

Retrieves or changes the label for this Tab.

 

Requests the user's attention on this tab.

 

Restore the DOM for this Tab

 

Updates this tab's view.

Methods borrowed from class jabberwerx.ui.JWView:
dimensions, height, parent, persistOptions, remove, render, restoreRender, restoreUpdate, shouldBeSavedWithGraph, show, wasUnserialized, width, willBeSerialized
Methods borrowed from class jabberwerx.JWModel:
applyEvent, event
Methods borrowed from class jabberwerx.JWBase:
getClassName, graphUnserialized, init, invocation, shouldBeSerializedInline, toString
Class Detail
jabberwerx.ui.TabbedView.Tab(tabview, content, id)

Creates a new Tab with the given tabview, content, and identifier.

Parameters:
{jabberwerx.ui.TabbedView} tabview
The owning TabbedView
{jabberwerx.ui.JWView} content
The contents view associated with this tab
{String} id
The identifier of this tab
Throws:
{TypeError}
If {id} is not a non-empty string; or if {content} is not an instance of jabberwerx.ui.JWView.
Field Detail
{jabberwerx.ui.JWView} content

The content this tab refers to.


{String} id

The identifier of this tab


{jabberwerx.ui.TabbedView} tabview

The owning TabbedView.

Method Detail
{Boolean} activate()

Activates this tab within its owning TabbedView. If this tab is renderd and not already active, it does the following:

  1. Deactivate the currently active tab (if any)
  2. Adds the "active" CSS class to this tab's DOM
  3. Shows the content for this tab within the TabbedView
  4. Triggers the "tabActivated" event on the owning TabbedView, with this Tab as the data

Regardless of this tab's previous active state, any pending notification is canceled.

Returns:
{Boolean} true if the tab selection changed

cancelAttention()

Cancels the attention request. This implementation reverts the tab to its normal state.


{Element} createDOM(doc)

Creates this Tab's DOM representation. This method creates the following:

 <div class='tab' id='jabberwerx_tabctrl_{tab.id}'>
     <img src='{path to theme images}/icon-close.png'
             alt='Close'
             title='Close'
             class='closer'/>
     <span class='notification'>&nbsp;</span>
     <a href='#' class='tab_link'>
         <span class='tab_label'>{tab.label() || tab.id}</span>
     </a>
 </div>
Parameters:
{Document} doc
The document to create this DOM with
Returns:
{Element} This Tab's DOM representatation

destroy()

Destroys this Tab. This implementation ensures the tab content is also destroyed.


destroyDOM()

Destroys this view's DOM. This method does the following:

  1. Cancels any pending attention request
  2. If this tab is active, an adjacent tab is activated (if any)
  3. If the content is still rendered and implements jabberwerx.ui.Tabbable#setTabControl, the method is called passing null (to indicate the content is being removed from a TabbedView)
  4. If the content is still rendered, it's jabberwerx.ui.JWView#remove is called
  5. Removes this tab from its owning TabbedView

{jabberwerx.ui.TabbedView.Tab} hide()

Makes this tab's header (and contents) hidden. If this tab is active, the closest visible tab is activated.

Returns:
{jabberwerx.ui.TabbedView.Tab} This tab

{Boolean} isActive()

Determines if this Tab is active.

This method returns false if the DOM has not been created.

Returns:
{Boolean} true If this tab is active

{String|jabberwerx.ui.TabbedView.Tab} label(label)

Retrieves or changes the label for this Tab. If the label is being changed, the view is also updated.

Parameters:
{String} label Optional
The new label, or undefined to retrieve the current label
Returns:
{String|jabberwerx.ui.TabbedView.Tab} The current label (if getting), or this Tab (if setting)

{Boolean} requestAttention(data)

Requests the user's attention on this tab. This implementation causes the tab's display to switch between the "attention" state and its normal state every second.

The "attention" state adds the "attn" CSS class to this tab's DOM, and applies the given data (if any) to the <span class='notification'/> within this tab's DOM.

Parameters:
{jQuery|Element|String} data Optional
The data to display as part of the attention request
Returns:
{Boolean} true if this request caused a visual change

{jQuery} restoreDOM(doc)

Restore the DOM for this Tab

Parameters:
{Document} doc
The document to use for creating content.
Returns:
{jQuery} The element containing the tab.

{Boolean} update()

Updates this tab's view. This implementation updates the tab's label to the value of #label, then updates its content.

Returns:
{Boolean} true if this view is updatable

Documentation generated by JsDoc Toolkit 2.4.0 on Wed Apr 02 2014 13:23:43 GMT-0600 (MDT)