Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Diff for new files should be all green.

  • Loading branch information...
commit d4dacf14b7c362d8fd284b77baa2278a21f3a5c2 1 parent 61be013
Brad Dunbar braddunbar authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 _includes/views/post.js
12 _includes/views/post.js
View
@@ -42,12 +42,12 @@ views.Post = Backbone.View.extend({
if (this.metadataEditor) this.model.raw_metadata = this.metadataEditor.getValue();
if (!this.$('.button.save').hasClass('saving')) {
this.$('.button.save').html(this.model.writeable ? "SAVE" : "SEND PATCH");
- this.$('.button.save').removeClass('inactive error');
+ this.$('.button.save').removeClass('inactive error');
}
},
showDiff: function() {
- var text1 = this.prevContent;
+ var text1 = this.model.persisted ? this.prevContent : '';
var text2 = this.serialize();
var d = this.dmp.diff_main(text1, text2);
this.dmp.diff_cleanupSemantic(d);
@@ -57,13 +57,13 @@ views.Post = Backbone.View.extend({
_toggleCommit: function() {
if (!this.$('.document-menu').hasClass('commit')) {
- this.$('.commit-message').val("Updated "+$('input.filepath').val());
+ this.$('.commit-message').val("Updated "+$('input.filepath').val());
}
this.hideMeta();
this.$('.button.save').html(this.$('.document-menu').hasClass('commit') ? (this.model.writeable ? "SAVE" : "SEND PATCH") : "COMMIT");
this.$('.button.save').toggleClass('confirm');
- this.$('.document-menu').toggleClass('commit');
+ this.$('.document-menu').toggleClass('commit');
this.$('.button.cancel-save').toggle();
this.$('.document-menu-content .options').hide();
this.showDiff();
@@ -192,7 +192,7 @@ views.Post = Backbone.View.extend({
updateFilename: function(filepath, cb) {
var that = this;
-
+
if (!_.validPathname(filepath)) return cb('error');
app.state.path = this.model.path; // ?
app.state.file = _.extractFilename(filepath)[1];
@@ -241,7 +241,7 @@ views.Post = Backbone.View.extend({
patchFile(app.state.user, app.state.repo, app.state.branch, filepath, filecontent, message, function(err) {
if (err) {
- _.delay(function() {
+ _.delay(function() {
that.$('.button.save').html("SEND PATCH");
that.$('.button.save').removeClass('error');
that.$('.button.save').addClass('inactive');
Please sign in to comment.
Something went wrong with that request. Please try again.