This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/assets/javascripts/discourse/views/parent_view.js
T
2013-06-06 16:45:25 -04:00

30 lines
641 B
JavaScript

/*global Markdown:true*/
/**
A control to support embedding a post as a parent of the current post (in reply to)
@class ParentView
@extends Discourse.EmbeddedPostView
@namespace Discourse
@module Discourse
**/
Discourse.ParentView = Discourse.EmbeddedPostView.extend({
previousPost: true,
// Nice animation for when the replies appear
didInsertElement: function() {
this._super();
var $parentPost = this.get('postView').$('section.parent-post');
// Animate unless we're on a touch device
if (Discourse.get('touch')) {
$parentPost.show();
} else {
$parentPost.slideDown();
}
}
});