carte-server 0.0.24 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/carte/client/views/edit.cjsx +31 -3
- data/package.json +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1588bcae30f07e9328f0544d3b0276ac7452fb40
|
4
|
+
data.tar.gz: 28ce06311f7becefb4f080e08d7abba02cd85e57
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b249cbf0dfd97b5e12c4ed0530377b842ab49d0ea18c0f25f7c4bd7e9d9f6272e96f73402c1ff141a9a0422f063c09f866609b59d4388df62ac7220b3be4abf4
|
7
|
+
data.tar.gz: d426ff1c3ce87509cbccdf60810243f65b854172166a60963772cbab89154ad4793ef229600fd9d65e600acb647b3be91f25394d086b24da105c92e61485b3c3
|
@@ -4,6 +4,7 @@ React = require('react/addons')
|
|
4
4
|
Modal = require('react-bootstrap/lib/Modal')
|
5
5
|
Button = require('react-bootstrap/lib/Button')
|
6
6
|
TagsInput = require('react-tagsinput')
|
7
|
+
CardModel = require('../models/card')
|
7
8
|
|
8
9
|
module.exports = React.createClass
|
9
10
|
mixins: [React.addons.LinkedStateMixin]
|
@@ -17,6 +18,8 @@ module.exports = React.createClass
|
|
17
18
|
tags: @props.card.get('tags') || []
|
18
19
|
errors: false
|
19
20
|
shaking: false
|
21
|
+
dontCloseDialog: false
|
22
|
+
createSuccess: false
|
20
23
|
|
21
24
|
onChangeTitle: (event)->
|
22
25
|
@setState title: event.target.value
|
@@ -24,6 +27,9 @@ module.exports = React.createClass
|
|
24
27
|
onChangeContent: (event)->
|
25
28
|
@setState content: event.target.value
|
26
29
|
|
30
|
+
onChangeDontCloseDialog: (event)->
|
31
|
+
@setState dontCloseDialog: !@state.dontCloseDialog
|
32
|
+
|
27
33
|
onClickOk: (event)->
|
28
34
|
event.preventDefault()
|
29
35
|
@setState updating: true
|
@@ -34,10 +40,19 @@ module.exports = React.createClass
|
|
34
40
|
@props.card.save attributes,
|
35
41
|
success: ()=>
|
36
42
|
@setState updating: false
|
37
|
-
@props.onRequestHide()
|
38
|
-
@props.card.set 'title', @state.title
|
39
43
|
if @props.card.isNew()
|
40
|
-
|
44
|
+
if @state.dontCloseDialog
|
45
|
+
@setState
|
46
|
+
createSuccess: true
|
47
|
+
title: ''
|
48
|
+
content: ''
|
49
|
+
tags: []
|
50
|
+
@props.card = new CardModel()
|
51
|
+
@props.card._isNew = true
|
52
|
+
else
|
53
|
+
@props.onRequestHide()
|
54
|
+
@props.card.set 'title', @state.title
|
55
|
+
location.hash = '/' + @state.title
|
41
56
|
error: (model, response, options)=>
|
42
57
|
console.log response.responseJSON
|
43
58
|
@setState errors: response.responseJSON.card.errors
|
@@ -59,6 +74,11 @@ module.exports = React.createClass
|
|
59
74
|
}
|
60
75
|
</ul>
|
61
76
|
</div>
|
77
|
+
else if @state.createSuccess
|
78
|
+
<div className="alert alert-success" role="alert" style={padding:'5px'}>
|
79
|
+
<i className="glyphicon glyphicon-info-sign" />
|
80
|
+
You created a card successfully. Let's create next one.
|
81
|
+
</div>
|
62
82
|
}
|
63
83
|
<div className="form-group">
|
64
84
|
<label class="control-label">Title</label>
|
@@ -72,6 +92,14 @@ module.exports = React.createClass
|
|
72
92
|
<label class="control-label">Tags</label>
|
73
93
|
<TagsInput ref='tags' valueLink={this.linkState('tags')} />
|
74
94
|
</div>
|
95
|
+
{
|
96
|
+
if @props.card.isNew()
|
97
|
+
<div className="checkbox">
|
98
|
+
<label>
|
99
|
+
<input type="checkbox" checked={@state.dontCloseDialog} onChange={@onChangeDontCloseDialog} /> Don't Close Dialog
|
100
|
+
</label>
|
101
|
+
</div>
|
102
|
+
}
|
75
103
|
<div className="form-group" style={{paddingBottom:'17px'}}>
|
76
104
|
<button className="btn btn-default pull-right" onClick={@onClickOk} disabled={@state.updating}>
|
77
105
|
|
data/package.json
CHANGED