API Docs for: 0.2.0
Show:

Deckster Class

Constructor

Deckster

(
  • element
  • [options]
)

Parameters:

  • element HTMLElement

    The HTMLElement that will hold the deck

  • [options] Object optional

    An Object will all the default options you wish to overwrite:

    • [showDock] Boolean optional

      Choose to show the Deck dock or not.

    • [showToolbar] Boolean optional

      Choose to show the Deck toolbar or not.

    • [autoInit] Boolean optional

      Choose whether or not to init the Deck automatically after creation.

    • [gridsterOpts] Object optional

      Define options for gridster.js. See available options here http://gridster.net/#documentation

Methods

addCard

(
  • card
  • callback
)
Deckster

Add a {Card} to the deck and load the cards data

Parameters:

  • card Object

    Card configuration

  • callback Function

    Callback function that gets called with card as param after card is added to the deck

Returns:

addCards

(
  • cards
)
Deckster

Add an {Array} of cards to the deck.

Parameters:

  • cards Array

    of {Card} configurations

Returns:

bindCardHandlers

() Card

Binds handlers to card element

Returns:

Card:

changeSection

(
  • newSection
  • oldSection
)
Card

Changes the section of the card from one section to another section

Parameters:

  • newSection Object

    Section the card is being changed to

  • oldSection Object

    Current section

Returns:

Card:

collapseCard

(
  • cb
)

Collapse the card

Parameters:

  • cb Object

    Callback to call after function has been collapsed

destroy

()

Destroy Deckster

expandCard

(
  • cb
)

Expand the card

Parameters:

  • cb Object

    Callback to call after function has been expanded

generatePopout

(
  • el
  • cardOpts
  • section
)
Card

Given a card configuration this function generates html for a card adds to the element and displays the given section.

Parameters:

  • el HTMLElement

    To bind card to

  • cardOpts Object

    Options used to configure card

  • section String

    'summary'|'details'

Returns:

Card:

instance of card

getCardData

() Object

Returns the current options associated with this card

Returns:

Object:

getCardHash

(
  • opts
)
Number

Returns a numerical hash for the value the card options passed in

Parameters:

  • opts Object

Returns:

Number:

getCardHtml

(
  • opts
)
HTMLElement | String

Generates the layout for a card with given options

Parameters:

  • opts Object

    locals used to generate layout for card

Returns:

HTMLElement | String:

of card layout html

getCards

() Array

Returns the cards in the deck

Returns:

Array:

getDefaults

() Object

Returns the card defaults

Returns:

Object:

Card defaults

getPopoutRoute

(
  • basePath
  • optionalIdentifier
)
Object

Generates route use for popouts

Parameters:

  • basePath Object

    The root path for DecksterJS

  • optionalIdentifier Object

    Character used to denote a parameter is optional. Default: '?'

Returns:

Object:

route

getRoutes

(
  • basePath
  • optionalIdentifier
)
Array

Generates routes used for DecksterJS

Parameters:

  • basePath Object

    The root path for DecksterJS

  • optionalIdentifier Object

    Character used to denote a parameter is optional. Default: '?'

Returns:

Array:

routes

hasCard

(
  • card
)
Boolean

Checks if a card is in the deck

Parameters:

  • card Object

    configurations of card

Returns:

Boolean:

init

(
  • cards
)

Initializes Deckster and adds cards if any are given

Parameters:

  • cards Object

    Cards to be added to the deck

loadCard

() Card

Loads the content of the different sections of the card. If lazyLoad is enabled only the summary content will be loaded when the card is initialized.

Returns:

Card:

loadContent

(
  • section
)
Card

Loads the content for the specified section

Parameters:

  • section String

    'summary'|'details'

Returns:

Card:

loadDetailsContent

() Card

Loads the details content for this card

Returns:

Card:

loadPopout

() Card

Loads the popout for a card. The card element won't have the layout injected yet so we need to do that first before loading the card.

Returns:

Card:

loadSummaryContent

() Card

Loads the summary content for this card

Returns:

Card:

reloadContent

() Card

Reloads the content of this card

Returns:

Card:

removeCard

(
  • card
)
Deckster

Remove a card from the deck

Parameters:

  • card Object

Returns:

setCardContent

(
  • section
  • html
)
Card

Loads the given HTML content into the specified section for this card

Parameters:

  • section String

    'summary'|'details'

  • html HTMLElement | String

    content for this section

Returns:

Card:

toggleCard

(
  • cb
)

Toggles a card between expanded and collapsed

Parameters:

  • cb Object

toggleSection

(
  • section
)
Card

Loads and displays the specified section if its not current displayed

Parameters:

  • section String

    'summary'|'details'

Returns:

Card:

widget_resized

(
  • e
  • ui
  • $widget
)
Deckster

Function fired when a widget is resized in gridster

Parameters:

  • e Object
  • ui Object
  • $widget Object

Returns: