lib/carte/client/views/edit.cjsx in carte-server-0.0.13 vs lib/carte/client/views/edit.cjsx in carte-server-0.0.14
- old
+ new
@@ -14,10 +14,11 @@
updating: false
title: @props.card.get('title')
content: @props.card.get('content')
tags: @props.card.get('tags') || []
errors: false
+ shaking: false
onChangeTitle: ->
@setState title: event.target.value
onChangeContent: ->
@@ -39,12 +40,14 @@
location.hash = '/' + @state.title
error: (model, response, options)=>
console.log response.responseJSON
@setState errors: response.responseJSON.card.errors
@setState updating: false
+ @setState shaking: true
+ setTimeout (=> @setState shaking: false), 300
render: ->
- <Modal {...@props} bsStyle='default' title={if @props.card.isNew() then <i className="glyphicon glyphicon-plus" /> else <i className="glyphicon glyphicon-edit" />} animation={false}>
+ <Modal className={"animated infinite shake" if @state.shaking} {...@props} bsStyle='default' title={if @props.card.isNew() then <i className="glyphicon glyphicon-plus" /> else <i className="glyphicon glyphicon-edit" />} animation={false}>
<div className='modal-body'>
{
if @state.errors
<div className="alert alert-danger" role="alert" style={padding:'5px'}>
<ul style={paddingLeft:"20px"}>