This repository has been archived on 2025-05-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
discourse/app/assets/javascripts/discourse/views/buttons/reply_button.js
2013-12-11 10:31:09 -05:00

31 lines
830 B
JavaScript

/**
A button for replying to a topic
@class ReplyButton
@extends Discourse.ButtonView
@namespace Discourse
@module Discourse
**/
Discourse.ReplyButton = Discourse.ButtonView.extend({
classNames: ['btn', 'btn-primary', 'create'],
attributeBindings: ['disabled'],
helpKey: 'topic.reply.help',
disabled: Em.computed.not('controller.model.details.can_create_post'),
text: function() {
var archetypeCapitalized = this.get('controller.content.archetype').capitalize();
var customTitle = this.get("parentView.replyButtonText" + archetypeCapitalized);
if (customTitle) { return customTitle; }
return I18n.t("topic.reply.title");
}.property(),
renderIcon: function(buffer) {
buffer.push("<i class='fa fa-plus'></i>");
},
click: function() {
this.get('controller').reply();
}
});