Skip to content

Commit ca53e73

Browse files
committed
list
1 parent 7033425 commit ca53e73

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

components/list/index.cjsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require './style'
1+
localCSS = require './style'
22

33
module.exports = React.createClass
44

@@ -11,17 +11,21 @@ module.exports = React.createClass
1111
type : React.PropTypes.string
1212

1313
getDefaultProps: ->
14-
attributes : ""
14+
attributes : ''
15+
className : ''
1516
dataSource : []
16-
type : "default"
17+
type : 'default'
1718

1819
# -- Events
1920
onClick: (event, item) ->
2021
@props.onClick? event, item
2122

2223
# -- Render
2324
render: ->
24-
<ul data-component-list={@props.type}>
25+
className = "#{localCSS.root} #{@props.className}"
26+
className += " #{@props.type}" if @props.type
27+
28+
<ul data-react-toolbox='list' className={className}>
2529
{
2630
for item, index in @props.dataSource
2731
<li key={index} onClick={@onClick.bind null, item}>

components/list/style.styl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
@import "../constants.styl"
1+
@import '../constants'
22

3-
[data-component-list]
3+
:local(.root)
44
list-style : none
55
&, a
66
color : TEXT
77
> li
88
overflow : hidden
99
background-color : WHITE
1010
box-shadow : ZDEPTH_SHADOW_1
11-
transition-property box-shadow
12-
transition-duration ANIMATION_DURATION
13-
transition-timing-function ANIMATION_EASE
14-
// -- Classes
11+
transition-property : box-shadow
12+
transition-duration : ANIMATION_DURATION
13+
transition-timing-function : ANIMATION_EASE
1514
&:hover
1615
box-shadow : ZDEPTH_SHADOW_2

0 commit comments

Comments
 (0)