Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge #268
  • 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>


<div class="fr menu-item save-state"> <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"> <div class="state fl">
<% if (writeable) { %><a class='toggle-options button' href='#'>&nbsp;</a><% } %> <% 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() { _toggleCommit: function() {
if (!this.$('.document-menu').hasClass('commit')) { 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(); this.hideMeta();
Expand All @@ -69,6 +69,7 @@ views.Post = Backbone.View.extend({
this.showDiff(); this.showDiff();
this.$('.surface').toggle(); this.$('.surface').toggle();
this.$('.diff-wrapper').toggle(); this.$('.diff-wrapper').toggle();
this.$('.commit-message').focus();


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


// Update content // Update content
Expand Down

0 comments on commit e4aec7f

Please sign in to comment.