README
wc-card-list
Displays a list of of items (meant to be cards)
Macro Settings
Key | Optional | Default | Description |
---|---|---|---|
items | false | List of items to iterate over | |
cols | true | [2, 4] | Number of columns you want to the list to switch between |
class | true | '' | Additional classes applied to .c-card-list |
JS Documentation
CardList
- CardList
- static
- inner
- ~CardList
- ~LISTENER_REGISTERED :
Boolean
- ~cardListList :
Array
- ~CLS_LIST :
String
- ~CLS_ITEM :
String
- ~CLS_AD :
String
- ~bindAdManagerListener()
- ~getAdFromList(list, ad) ⇒
Number
- ~hasAdSlot(el) ⇒
Boolean
- ~isInitialised(el) ⇒
Boolean
- ~onAdRenderStop(e)
- ~onManagerRegister(e)
- ~setInitialised(el)
- ~toArray(collection) ⇒
Array
- ~unbindAdManagerListener()
CardList.init()
Initialises the cards in the list
Kind: static method of CardList
CardList~CardList
Kind: inner class of CardList
new CardList(el)
Param | Type | Description |
---|---|---|
el | HTMLElement |
The card list |
Boolean
CardList~LISTENER_REGISTERED : AdManager register listener boolean
Kind: inner property of CardList
Array
CardList~cardListList : List of CardLists
Kind: inner property of CardList
String
CardList~CLS_LIST : Card list css class
Kind: inner constant of CardList
String
CardList~CLS_ITEM : Card list item css class
Kind: inner constant of CardList
String
CardList~CLS_AD : Card list ad css class
Kind: inner constant of CardList
CardList~bindAdManagerListener()
Binds listeners to AdManager register event
Kind: inner method of CardList
Number
CardList~getAdFromList(list, ad) ⇒ Finds the ad in the list
Kind: inner method of CardList
Returns: Number
- The index
Param | Type |
---|---|
list | Array.<Ad> |
ad | Ad |
Boolean
CardList~hasAdSlot(el) ⇒ Checks if the element contains ad element
Kind: inner method of CardList
Param | Type |
---|---|
el | HTMLElement |
Boolean
CardList~isInitialised(el) ⇒ Checks if the element is initialised
Kind: inner method of CardList
Param | Type |
---|---|
el | HTMLElement |
CardList~onAdRenderStop(e)
Callback for when an Ad fires render or stop
Kind: inner method of CardList
Param | Type |
---|---|
e | Object |
CardList~onManagerRegister(e)
Callback for when the AdManager emits a register event
Kind: inner method of CardList
Param | Type |
---|---|
e | Object |
CardList~setInitialised(el)
Sets the card list element to initialised
Kind: inner method of CardList
Param | Type |
---|---|
el | HTMLElement |
Array
CardList~toArray(collection) ⇒ Converts a collection to an array
Kind: inner method of CardList
Param | Type |
---|---|
collection | * |
CardList~unbindAdManagerListener()
Unbinds the AdManager register listener
Kind: inner method of CardList
CardList~CardList
Kind: inner class of CardList
new CardList(el)
Param | Type | Description |
---|---|---|
el | HTMLElement |
The card list |
Current themes
- Wired
- Glamour
Prerequisites:
Demo:
Install dependencies:
npm install
Build the things:
npm run sass
npm run js
Python the pythons:
cd demo
virtualenv .
source bin/activate
pip install -r requirements.txt
Start the demo server:
python demo.py