|
@@ -69,6 +69,8 @@ var EditComment = function (_React$Component) {
|
69
|
69
|
_createClass(EditComment, [{
|
70
|
70
|
key: "handleSubmit",
|
71
|
71
|
value: function handleSubmit(_ref) {
|
|
72
|
+ var _this2 = this;
|
|
73
|
+
|
72
|
74
|
var _ref$text = _ref.text,
|
73
|
75
|
text = _ref$text === undefined ? "" : _ref$text,
|
74
|
76
|
_ref$files = _ref.files,
|
|
@@ -92,12 +94,21 @@ var EditComment = function (_React$Component) {
|
92
|
94
|
if (value.substr(-1) === ",") {
|
93
|
95
|
value = value.slice(0, -1);
|
94
|
96
|
}
|
|
97
|
+ // 成功回调,失败不自动关闭
|
|
98
|
+ var successCallback = function successCallback() {
|
|
99
|
+ _this2.props.handleClose();
|
|
100
|
+ };
|
95
|
101
|
if (action === "comment") {
|
96
|
|
- app.sUpdateComment({ commentId: commentId, content: value });
|
|
102
|
+ app.sUpdateComment({ commentId: commentId, content: value, successCallback: successCallback });
|
97
|
103
|
} else {
|
98
|
|
- app.sUpdateReply({ commentId: commentId, content: value, replyId: replyId, replyPage: replyPage });
|
|
104
|
+ app.sUpdateReply({
|
|
105
|
+ commentId: commentId,
|
|
106
|
+ content: value,
|
|
107
|
+ replyId: replyId,
|
|
108
|
+ replyPage: replyPage,
|
|
109
|
+ successCallback: successCallback
|
|
110
|
+ });
|
99
|
111
|
}
|
100
|
|
- this.props.handleClose();
|
101
|
112
|
}
|
102
|
113
|
}, {
|
103
|
114
|
key: "getInitValue",
|
|
@@ -168,7 +179,7 @@ var EditComment = function (_React$Component) {
|
168
|
179
|
}, {
|
169
|
180
|
key: "render",
|
170
|
181
|
value: function render() {
|
171
|
|
- var _this2 = this;
|
|
182
|
+ var _this3 = this;
|
172
|
183
|
|
173
|
184
|
return _react2.default.createElement(
|
174
|
185
|
_modal2.default,
|
|
@@ -195,12 +206,12 @@ var EditComment = function (_React$Component) {
|
195
|
206
|
fileList: this.state.fileList,
|
196
|
207
|
value: this.props.preRenderValue && this.props.preRenderValue(this.state.value),
|
197
|
208
|
onChange: function onChange(value) {
|
198
|
|
- _this2.setState({
|
|
209
|
+ _this3.setState({
|
199
|
210
|
value: value
|
200
|
211
|
});
|
201
|
212
|
},
|
202
|
213
|
handleChangeFileList: function handleChangeFileList(fileList) {
|
203
|
|
- _this2.setState({
|
|
214
|
+ _this3.setState({
|
204
|
215
|
fileList: fileList
|
205
|
216
|
});
|
206
|
217
|
},
|