FEATURE: add glyphs in the composer 'save' button

This commit is contained in:
Régis Hanol 2014-09-08 19:02:53 +02:00
parent ea6cab66cb
commit 948e0740c9
2 changed files with 11 additions and 1 deletions

View File

@ -140,6 +140,16 @@ Discourse.Composer = Discourse.Model.extend({
return (this.get('titleLength') <= Discourse.SiteSettings.max_topic_title_length);
}.property('minimumTitleLength', 'titleLength', 'post.static_doc'),
// The icon for the save button
saveIcon: function () {
switch (this.get('action')) {
case EDIT: return '<i class="fa fa-pencil"></i>';
case REPLY: return '<i class="fa fa-reply"></i>';
case CREATE_TOPIC: return '<i class="fa fa-plus"></i>';
case PRIVATE_MESSAGE: return '<i class="fa fa-envelope"></i>';
}
}.property('action'),
// The text for the save button
saveText: function() {
switch (this.get('action')) {

View File

@ -89,7 +89,7 @@
{{#if currentUser}}
<div class='submit-panel'>
<button {{action save}} tabindex="5" {{bind-attr class=":btn :btn-primary :create disableSubmit:disabled"}} title="{{i18n composer.title}}">{{model.saveText}}</button>
<button {{action save}} tabindex="5" {{bind-attr class=":btn :btn-primary :create disableSubmit:disabled"}} title="{{i18n composer.title}}">{{{model.saveIcon}}}{{model.saveText}}</button>
<a href='#' {{action cancel}} class='cancel' tabindex="6">{{i18n cancel}}</a>
</div>
{{/if}}