From aa4cbd7a6b98df16f0307b28d07445270d8914b8 Mon Sep 17 00:00:00 2001 From: Javi Velasco Date: Fri, 18 Sep 2015 21:06:00 +0200 Subject: [PATCH] Adapt card to new ripple --- components/card/index.cjsx | 15 ++------------- components/card/style.styl | 11 +++++------ 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/components/card/index.cjsx b/components/card/index.cjsx index 577295ebc..776beff85 100644 --- a/components/card/index.cjsx +++ b/components/card/index.cjsx @@ -23,20 +23,10 @@ module.exports = React.createClass getInitialState: -> loading : @props.loading - ripple : undefined - - # -- Lifecycle - componentWillReceiveProps: -> - @setState ripple: undefined # -- Events onClick: (event) -> event.preventDefault() if @props.onClick? - client = event.target.getBoundingClientRect?() - @setState ripple: - left : event.pageX - client?.left - top : event.pageY - client?.top - width : (client?.width * 2.5) @props.onClick? event, @ # -- Render @@ -51,7 +41,7 @@ module.exports = React.createClass style.backgroundImage = "url(#{@props.image})" if @props.image? style.backgroundColor = @props.color if @props.color -
+
{ if @props.title or @props.image
@@ -62,11 +52,10 @@ module.exports = React.createClass {

{@props.text}

if @props.text } { {@props.legend} if @props.legend } { if @props.actions } - { } + { }
# -- Extends loading: (value) -> attributes = loading: value - attributes.ripple = undefined unless value @setState attributes diff --git a/components/card/style.styl b/components/card/style.styl index bee77476e..c221f64db 100644 --- a/components/card/style.styl +++ b/components/card/style.styl @@ -6,7 +6,6 @@ OFFSET = (SPACE / 1.25) :local(.navigation) padding : OFFSET = (OFFSET / 2) > * - pointer-events : all padding-left : OFFSET padding-right : OFFSET box-shadow : none !important @@ -33,17 +32,14 @@ OFFSET = (SPACE / 1.25) background : WHITE // -- Children - *:not(button) - pointer-events : none > *:not(:local(.ripple)):not(:local(.navigation)) padding : OFFSET &:not(.color):not(.image) > :local(.ripple) - background-color : DIVIDER + background-color : red &:not(.color) > *:not(figure), > *:not(:last-child) box-shadow : 0 1px darken(BACKGROUND, 5%) > :local(.figure) - // -- Overrides &.touch cursor : pointer @@ -59,7 +55,7 @@ OFFSET = (SPACE / 1.25) -webkit-filter : grayscale(100%) &, &:hover box-shadow : 0 0 0 1px DIVIDER - > :local(.ripple) + :local(.ripple) width : SIZE = (SIZE * 2) height : SIZE &.small > :local(.figure) @@ -68,3 +64,6 @@ OFFSET = (SPACE / 1.25) height : SIZE &.wide width : (SIZE * 2) + +:local(.ripple) + background-color: #888