diff --git a/app/assets/javascripts/discourse/models/composer.js b/app/assets/javascripts/discourse/models/composer.js index 9709b5529bc..53127ad824d 100644 --- a/app/assets/javascripts/discourse/models/composer.js +++ b/app/assets/javascripts/discourse/models/composer.js @@ -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')) { diff --git a/app/assets/javascripts/discourse/templates/composer.js.handlebars b/app/assets/javascripts/discourse/templates/composer.js.handlebars index a907c32468a..0a614137152 100644 --- a/app/assets/javascripts/discourse/templates/composer.js.handlebars +++ b/app/assets/javascripts/discourse/templates/composer.js.handlebars @@ -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}}