lib/carte/client/views/edit.cjsx in carte-server-0.0.28 vs lib/carte/client/views/edit.cjsx in carte-server-1.0.0
- old
+ new
@@ -42,18 +42,23 @@
@setState updating: false
if @props.card.isNew()
if @state.dontCloseDialog
@setState
createSuccess: true
+ errors: null
title: ''
content: ''
tags: []
@props.card = new CardModel()
@props.card._isNew = true
else
@props.onRequestHide()
@props.card.set 'title', @state.title
location.hash = '/' + @state.title
+ else
+ @props.onRequestHide()
+ @props.card = new CardModel()
+ @props.card._isNew = true
error: (model, response, options)=>
@setState errors: response.responseJSON.card.errors
@setState updating: false
@setState shaking: true
setTimeout (=> @setState shaking: false), 300