Arrows to navigate to embedded posts.
This commit is contained in:
parent
674c861eaf
commit
fc1c120014
|
@ -164,8 +164,10 @@ window.Discourse.Post = Ember.Object.extend Discourse.Presence,
|
|||
@set('loadingReplies', true)
|
||||
@set('replies', [])
|
||||
jQuery.getJSON "/posts/#{@get('id')}/replies", (loaded) =>
|
||||
loaded.each (reply) =>
|
||||
@get('replies').pushObject Discourse.Post.create(reply)
|
||||
loaded.each (reply) =>
|
||||
post = Discourse.Post.create(reply)
|
||||
post.set('topic', @get('topic'))
|
||||
@get('replies').pushObject post
|
||||
@set('loadingReplies', false)
|
||||
promise.resolve()
|
||||
promise
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
|
||||
</div>
|
||||
<div class='span11 topic-body'>
|
||||
{{#if view.previousPost}}<a href='{{unbound url}}' class="arrow"><i class='icon icon-arrow-up'></i></a>{{/if}}
|
||||
{{{unbound cooked}}}
|
||||
{{#unless view.previousPost}}<a href='{{unbound url}}' class="arrow"><i class='icon icon-arrow-down'></i></a>{{/unless}}
|
||||
</div>
|
||||
</div>
|
||||
{{/with}}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
window.Discourse.EmbeddedPostView = Ember.View.extend
|
||||
templateName: 'embedded_post'
|
||||
classNames: ['reply']
|
||||
screenTrackBinding: 'postView.screenTrack'
|
||||
|
||||
didInsertElement: ->
|
||||
postView = @get('postView') || @get('parentView.postView')
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
window.Discourse.ParentView = Discourse.EmbeddedPostView.extend
|
||||
|
||||
previousPost: true
|
||||
|
||||
# Nice animation for when the replies appear
|
||||
didInsertElement: ->
|
||||
@_super()
|
||||
|
|
|
@ -100,6 +100,10 @@ window.Discourse.PostView = Ember.View.extend
|
|||
$('nav', $parent).addClass('toggled')
|
||||
Discourse.Post.loadByPostNumber post.get('topic_id'), post.get('reply_to_post_number'), (result) =>
|
||||
@set('loadingParent', false)
|
||||
|
||||
# Give the post a reference back to the topic
|
||||
result.topic = @get('post.topic')
|
||||
|
||||
@set('parentPost', result)
|
||||
|
||||
false
|
||||
|
|
|
@ -427,6 +427,12 @@
|
|||
&:after {
|
||||
left: -9px;
|
||||
}
|
||||
|
||||
a.arrow {
|
||||
float: right;
|
||||
margin: 3px 0 3px 0;
|
||||
}
|
||||
|
||||
}
|
||||
.about {
|
||||
.contents {
|
||||
|
|
Loading…
Reference in New Issue