ButtonBox
Extends:
An Element to easily construct nested HTML Menus It contains of a button followed by a body below the button. The button can toggle the visibility of the body. If multiple elements with the same classname are nested it gives the last visible element a special class name. It can also marks one or multiple element in the tree to be active (same classname is needed, too). After a ButtonBox has been added all child elements the method finish should be called.
Constructor Summary
Public Constructor | ||
public |
constructor(options: ButtonBoxOptions) |
Member Summary
Public Members | ||
public |
$element_: * |
|
public |
classNames_: {"body": *, "collapseButton": *, "titleButton": *, "title": *, "active": *, "collapsed": *, "lastVisible": *} |
Private Members | ||
private |
$body_: jQuery |
|
private |
$title_: jQuery |
|
private |
|
|
private |
|
|
private |
|
|
private |
|
Method Summary
Public Methods | ||
public |
finish() This method should be called after all child elements have been added to the button box |
|
public |
get$Body(): jQuery Returns the body element |
|
public |
get$Element(): jQuery Returns the element itself |
|
public |
|
|
public |
giveLastVisible($element: *) Gives the last element in the element the last visible class |
|
public |
setCollapseButtonActive(active: *) |
|
public |
setCollapsed(collapsed: boolean, silent: boolean) |
|
public |
setTitleButtonActive(active: *) |
|
public |
takeLastVisible($element: jQuery): boolean Searches for the last visible class in its child elements and removes it. |
Private Methods | ||
private |
get$LastChild_($element: jQuery): jQuery finds and returns the last child in the body of the given element if it is of the same classname as this ButtonBox |
|
private |
distribute the last visible class to the correct element |
Public Constructors
public constructor(options: ButtonBoxOptions) source
Params:
Name | Type | Attribute | Description |
options | ButtonBoxOptions |
|
Public Members
public $element_: * source
public classNames_: {"body": *, "collapseButton": *, "titleButton": *, "title": *, "active": *, "collapsed": *, "lastVisible": *} source
Private Members
private $body_: jQuery source
private $title_: jQuery source
Public Methods
public finish() source
This method should be called after all child elements have been added to the button box
public giveLastVisible($element: *) source
Gives the last element in the element the last visible class
Params:
Name | Type | Attribute | Description |
$element | * |
public setCollapseButtonActive(active: *) source
Params:
Name | Type | Attribute | Description |
active | * |
public setTitleButtonActive(active: *) source
Params:
Name | Type | Attribute | Description |
active | * |
public takeLastVisible($element: jQuery): boolean source
Searches for the last visible class in its child elements and removes it. Returns true if it was removed.
Params:
Name | Type | Attribute | Description |
$element | jQuery |
Private Methods
private get$LastChild_($element: jQuery): jQuery source
finds and returns the last child in the body of the given element if it is of the same classname as this ButtonBox
Params:
Name | Type | Attribute | Description |
$element | jQuery |
Return:
jQuery |