@cnbritain/wc-card-list v3.3.14
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 |
CardList~LISTENER_REGISTERED : Boolean
AdManager register listener boolean
Kind: inner property of CardList
CardList~cardListList : Array
List of CardLists
Kind: inner property of CardList
CardList~CLS_LIST : String
Card list css class
Kind: inner constant of CardList
CardList~CLS_ITEM : String
Card list item css class
Kind: inner constant of CardList
CardList~CLS_AD : String
Card list ad css class
Kind: inner constant of CardList
CardList~bindAdManagerListener()
Binds listeners to AdManager register event
Kind: inner method of CardList
CardList~getAdFromList(list, ad) ⇒ Number
Finds the ad in the list
Kind: inner method of CardList
Returns: Number - The index
| Param | Type |
|---|---|
| list | Array.<Ad> |
| ad | Ad |
CardList~hasAdSlot(el) ⇒ Boolean
Checks if the element contains ad element
Kind: inner method of CardList
| Param | Type |
|---|---|
| el | HTMLElement |
CardList~isInitialised(el) ⇒ Boolean
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 |
CardList~toArray(collection) ⇒ Array
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 installBuild the things:
npm run sass
npm run jsPython the pythons:
cd demo
virtualenv .
source bin/activate
pip install -r requirements.txtStart the demo server:
python demo.py8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago
10 years ago