Skip to content

Commit

Permalink
Merge #268
Browse files Browse the repository at this point in the history
  • Loading branch information
dhcole committed Mar 25, 2013
2 parents 456366c + 9c8bc0b commit e4aec7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion _includes/templates/post._
Expand Up @@ -12,7 +12,7 @@
</div>

<div class="fr menu-item save-state">
<input type="text" class="commit-message" value="Updated."/>
<input type="text" class="commit-message" value=""/>
<div class="state fl">
<% if (writeable) { %><a class='toggle-options button' href='#'>&nbsp;</a><% } %>

Expand Down
5 changes: 3 additions & 2 deletions _includes/views/post.js
Expand Up @@ -57,7 +57,7 @@ views.Post = Backbone.View.extend({

_toggleCommit: function() {
if (!this.$('.document-menu').hasClass('commit')) {
this.$('.commit-message').val("Updated "+$('input.filepath').val());
this.$('.commit-message').attr( 'placeholder', "Updated "+$('input.filepath').val());
}

this.hideMeta();
Expand All @@ -69,6 +69,7 @@ views.Post = Backbone.View.extend({
this.showDiff();
this.$('.surface').toggle();
this.$('.diff-wrapper').toggle();
this.$('.commit-message').focus();

return false;
},
Expand Down Expand Up @@ -306,7 +307,7 @@ views.Post = Backbone.View.extend({
filepath = $('input.filepath').val(),
filename = _.extractFilename(filepath)[1],
filecontent = this.serialize(),
message = this.$('.commit-message').val(),
message = this.$('.commit-message').val() || this.$('.commit-message').attr('placeholder'),
method = this.model.writeable ? this.saveFile : this.sendPatch;

// Update content
Expand Down

0 comments on commit e4aec7f

Please sign in to comment.