mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: stage post in stream on edit
This commit is contained in:
parent
1386f9c8c9
commit
3dcd6edb46
@ -113,6 +113,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
|
|||||||
postAtts.actionCodeWho = post.action_code_who;
|
postAtts.actionCodeWho = post.action_code_who;
|
||||||
postAtts.userCustomFields = post.user_custom_fields;
|
postAtts.userCustomFields = post.user_custom_fields;
|
||||||
postAtts.topicUrl = topic.get('url');
|
postAtts.topicUrl = topic.get('url');
|
||||||
|
postAtts.isSaving = post.isSaving;
|
||||||
|
|
||||||
const showPMMap = topic.archetype === 'private_message' && post.post_number === 1;
|
const showPMMap = topic.archetype === 'private_message' && post.post_number === 1;
|
||||||
if (showPMMap) {
|
if (showPMMap) {
|
||||||
|
@ -539,7 +539,7 @@ const Composer = RestModel.extend({
|
|||||||
cooked: this.getCookedHtml()
|
cooked: this.getCookedHtml()
|
||||||
};
|
};
|
||||||
|
|
||||||
this.set('composeState', CLOSED);
|
this.set('composeState', SAVING);
|
||||||
|
|
||||||
var rollback = throwAjaxError(function(){
|
var rollback = throwAjaxError(function(){
|
||||||
post.set('cooked', oldCooked);
|
post.set('cooked', oldCooked);
|
||||||
@ -547,6 +547,8 @@ const Composer = RestModel.extend({
|
|||||||
});
|
});
|
||||||
|
|
||||||
return promise.then(function() {
|
return promise.then(function() {
|
||||||
|
// rest model only sets props after it is saved
|
||||||
|
post.set("cooked", props.cooked);
|
||||||
return post.save(props).then(function(result) {
|
return post.save(props).then(function(result) {
|
||||||
self.clearState();
|
self.clearState();
|
||||||
return result;
|
return result;
|
||||||
|
@ -401,7 +401,7 @@ export default createWidget('post', {
|
|||||||
if (attrs.cloaked) { return 'cloaked-post'; }
|
if (attrs.cloaked) { return 'cloaked-post'; }
|
||||||
const classNames = ['topic-post', 'clearfix'];
|
const classNames = ['topic-post', 'clearfix'];
|
||||||
|
|
||||||
if (attrs.id === -1) { classNames.push('staged'); }
|
if (attrs.id === -1 || attrs.isSaving) { classNames.push('staged'); }
|
||||||
if (attrs.selected) { classNames.push('selected'); }
|
if (attrs.selected) { classNames.push('selected'); }
|
||||||
if (attrs.topicOwner) { classNames.push('topic-owner'); }
|
if (attrs.topicOwner) { classNames.push('topic-owner'); }
|
||||||
if (attrs.hidden) { classNames.push('post-hidden'); }
|
if (attrs.hidden) { classNames.push('post-hidden'); }
|
||||||
|
Loading…
Reference in New Issue
Block a user