Deckster Class
Constructor
Deckster
-
element
-
[options]
Parameters:
-
element
HTMLElementThe HTMLElement that will hold the deck
-
[options]
Object optionalAn Object will all the default options you wish to overwrite:
-
[showDock]
Boolean optionalChoose to show the Deck dock or not.
-
[showToolbar]
Boolean optionalChoose to show the Deck toolbar or not.
-
[autoInit]
Boolean optionalChoose whether or not to init the Deck automatically after creation.
-
[gridsterOpts]
Object optionalDefine options for gridster.js. See available options here http://gridster.net/#documentation
-
Item Index
Methods
- addCard
- addCards
- bindCardHandlers
- changeSection
- collapseCard
- destroy
- expandCard
- generatePopout
- getCardData
- getCardHash
- getCardHtml
- getCards
- getDefaults
- getPopoutRoute
- getRoutes
- hasCard
- init
- loadCard
- loadContent
- loadDetailsContent
- loadPopout
- loadSummaryContent
- reloadContent
- removeCard
- setCardContent
- toggleCard
- toggleSection
- widget_resized
Methods
addCard
-
card
-
callback
Add a {Card} to the deck and load the cards data
Parameters:
-
card
ObjectCard configuration
-
callback
FunctionCallback function that gets called with card as param after card is added to the deck
Returns:
addCards
-
cards
Add an {Array} of cards to the deck.
Parameters:
-
cards
Arrayof {Card} configurations
Returns:
changeSection
-
newSection
-
oldSection
Changes the section of the card from one section to another section
Parameters:
-
newSection
ObjectSection the card is being changed to
-
oldSection
ObjectCurrent section
Returns:
collapseCard
-
cb
Collapse the card
Parameters:
-
cb
ObjectCallback to call after function has been collapsed
destroy
()
Destroy Deckster
expandCard
-
cb
Expand the card
Parameters:
-
cb
ObjectCallback to call after function has been expanded
generatePopout
-
el
-
cardOpts
-
section
Given a card configuration this function generates html for a card adds to the element and displays the given section.
Parameters:
-
el
HTMLElementTo bind card to
-
cardOpts
ObjectOptions used to configure card
-
section
String'summary'|'details'
Returns:
instance of card
getCardData
()
Object
Returns the current options associated with this card
Returns:
getCardHash
-
opts
Returns a numerical hash for the value the card options passed in
Parameters:
-
opts
Object
Returns:
getCardHtml
-
opts
Generates the layout for a card with given options
Parameters:
-
opts
Objectlocals used to generate layout for card
Returns:
of card layout html
getCards
()
Array
Returns the cards in the deck
Returns:
getDefaults
()
Object
Returns the card defaults
Returns:
Card defaults
getPopoutRoute
-
basePath
-
optionalIdentifier
Generates route use for popouts
Parameters:
-
basePath
ObjectThe root path for DecksterJS
-
optionalIdentifier
ObjectCharacter used to denote a parameter is optional. Default: '?'
Returns:
route
getRoutes
-
basePath
-
optionalIdentifier
Generates routes used for DecksterJS
Parameters:
-
basePath
ObjectThe root path for DecksterJS
-
optionalIdentifier
ObjectCharacter used to denote a parameter is optional. Default: '?'
Returns:
routes
hasCard
-
card
Checks if a card is in the deck
Parameters:
-
card
Objectconfigurations of card
Returns:
init
-
cards
Initializes Deckster and adds cards if any are given
Parameters:
-
cards
ObjectCards 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:
loadContent
-
section
Loads the content for the specified section
Parameters:
-
section
String'summary'|'details'
Returns:
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:
setCardContent
-
section
-
html
Loads the given HTML content into the specified section for this card
Parameters:
-
section
String'summary'|'details'
-
html
HTMLElement | Stringcontent for this section
Returns:
toggleCard
-
cb
Toggles a card between expanded and collapsed
Parameters:
-
cb
Object