mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
FEATURE: stage post in stream on edit
This commit is contained in:
parent
1386f9c8c9
commit
3dcd6edb46
3 changed files with 5 additions and 2 deletions
|
@ -113,6 +113,7 @@ export default function transformPost(currentUser, site, post, prevPost, nextPos
|
|||
postAtts.actionCodeWho = post.action_code_who;
|
||||
postAtts.userCustomFields = post.user_custom_fields;
|
||||
postAtts.topicUrl = topic.get('url');
|
||||
postAtts.isSaving = post.isSaving;
|
||||
|
||||
const showPMMap = topic.archetype === 'private_message' && post.post_number === 1;
|
||||
if (showPMMap) {
|
||||
|
|
|
@ -539,7 +539,7 @@ const Composer = RestModel.extend({
|
|||
cooked: this.getCookedHtml()
|
||||
};
|
||||
|
||||
this.set('composeState', CLOSED);
|
||||
this.set('composeState', SAVING);
|
||||
|
||||
var rollback = throwAjaxError(function(){
|
||||
post.set('cooked', oldCooked);
|
||||
|
@ -547,6 +547,8 @@ const Composer = RestModel.extend({
|
|||
});
|
||||
|
||||
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) {
|
||||
self.clearState();
|
||||
return result;
|
||||
|
|
|
@ -401,7 +401,7 @@ export default createWidget('post', {
|
|||
if (attrs.cloaked) { return 'cloaked-post'; }
|
||||
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.topicOwner) { classNames.push('topic-owner'); }
|
||||
if (attrs.hidden) { classNames.push('post-hidden'); }
|
||||
|
|
Loading…
Reference in a new issue