Deckster Class
Constructor
Deckster
-
element -
[options]
Parameters:
-
elementHTMLElementThe 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:
-
cardObjectCard configuration
-
callbackFunctionCallback 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:
-
cardsArrayof {Card} configurations
Returns:
changeSection
-
newSection -
oldSection
Changes the section of the card from one section to another section
Parameters:
-
newSectionObjectSection the card is being changed to
-
oldSectionObjectCurrent section
Returns:
collapseCard
-
cb
Collapse the card
Parameters:
-
cbObjectCallback to call after function has been collapsed
destroy
()
Destroy Deckster
expandCard
-
cb
Expand the card
Parameters:
-
cbObjectCallback 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:
-
elHTMLElementTo bind card to
-
cardOptsObjectOptions used to configure card
-
sectionString'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:
-
optsObject
Returns:
getCardHtml
-
opts
Generates the layout for a card with given options
Parameters:
-
optsObjectlocals 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:
-
basePathObjectThe root path for DecksterJS
-
optionalIdentifierObjectCharacter used to denote a parameter is optional. Default: '?'
Returns:
route
getRoutes
-
basePath -
optionalIdentifier
Generates routes used for DecksterJS
Parameters:
-
basePathObjectThe root path for DecksterJS
-
optionalIdentifierObjectCharacter used to denote a parameter is optional. Default: '?'
Returns:
routes
hasCard
-
card
Checks if a card is in the deck
Parameters:
-
cardObjectconfigurations of card
Returns:
init
-
cards
Initializes Deckster and adds cards if any are given
Parameters:
-
cardsObjectCards 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:
-
sectionString'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:
-
sectionString'summary'|'details'
-
htmlHTMLElement | Stringcontent for this section
Returns:
toggleCard
-
cb
Toggles a card between expanded and collapsed
Parameters:
-
cbObject
