Class Box

Define a Box block to be displayed into a JBlocks.

Class Summary
Constructor Attributes Constructor Name and Description
 
Box()

A Box block holds a header with title and menu.

Method Summary

Class Detail

Box()

A Box block holds a header with title and menu. The class must be overloaded to add content.

The constructor should not be invoked directly but JBlocks#newBlock or JBlocks#addNewBlock should be used instead.

Method Detail

  • init(layout, options)
    Initializes a Box block. The method is invoked by the jBlocks core and must never be called directly.
    Parameters:
    {Object} layout Optional
    see Block#init.
    {Object} options Optional
    in addition to base class options JBlock#init:
    {Array} options.title Optional
    the title to appear in the Box header.
    {Boolean} options.haveClose Optional, Default: false
    have an icon to close the block.
    {Boolean} options.haveFullscreen Optional, Default: false
    have a Fullscreen entry in the menu.
    {Boolean} options.haveSearch Optional, Default: false
    have a icon to search.
    {Boolean} options.haveLogo Optional, Default: false
    have an illustration icon
    {Array} options.menuItems Optional
    additional menu items.
    {Function} options.onSearchClick Optional
    additional function to be called when the search icon is clicked.
    {String} options.closeIconClass Optional, Default: "jblocks-icon-close"
    class to be used for Close icon.
    {String} options.shrinkIconClass Optional, Default: "jblocks-icon-shrink"
    class to be used for Shrink icon.
    {String} options.growIconClass Optional, Default: "jblocks-icon-grow"
    class to be used for Grow icon.
    {String} options.searchIconClass Optional, Default: "jblocks-icon-search"
    class to be used for Search icon.
    {String} options.iconsBaseClass Optional, Default: "jblocks-block-icon"
    base class to be used for icons.
    {String} options.logoIconClass Optional, Default: "jblocks-block-icon-logo"
    base class to be used for icons.
    {String} options.focusOnTitleClick Optional, Default: true
    focus block if title is clicked
  • setContent(className, options)
    This method is to be used when the Box block is intended to have a single block as content. A new block is created, eventually replacing a former content block.
    Parameters:
    {String} className
    the name of the class for the content block.
    {Object} options Optional
    options for the new block. The options parameters depends on the actual block class.
    Returns:
    the newly created block.
  • setTitle(title)
    Change the title of the box.
    Parameters:
    {String} title
    the new title string.